io.opencensus.tags.TagKey Java Examples

The following examples show how to use io.opencensus.tags.TagKey. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TagContextDeserializationTest.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@Test
public void stopParsingAtUnknownField() throws TagContextDeserializationException {
  ByteArrayDataOutput output = ByteStreams.newDataOutput();
  output.write(BinarySerializationUtils.VERSION_ID);
  encodeTagToOutput("Key1", "Value1", output);
  encodeTagToOutput("Key2", "Value2", output);

  // Write unknown field ID 1.
  output.write(1);
  output.write(new byte[] {1, 2, 3, 4});

  encodeTagToOutput("Key3", "Value3", output);

  // key 3 should not be included
  TagContext expected =
      tagger
          .emptyBuilder()
          .put(TagKey.create("Key1"), TagValue.create("Value1"))
          .put(TagKey.create("Key2"), TagValue.create("Value2"))
          .build();
  assertThat(serializer.fromByteArray(output.toByteArray())).isEqualTo(expected);
}
 
Example #2
Source File: TagContextSerializationTest.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@Test
public void testSerializeTooLargeTagContext() throws TagContextSerializationException {
  TagContextBuilder builder = tagger.emptyBuilder();
  for (int i = 0; i < BinarySerializationUtils.TAGCONTEXT_SERIALIZED_SIZE_LIMIT / 8 - 1; i++) {
    // Each tag will be with format {key : "0123", value : "0123"}, so the length of it is 8.
    String str;
    if (i < 10) {
      str = "000" + i;
    } else if (i < 100) {
      str = "00" + i;
    } else if (i < 1000) {
      str = "0" + i;
    } else {
      str = String.valueOf(i);
    }
    builder.put(TagKey.create(str), TagValue.create(str));
  }
  // The last tag will be of size 9, so the total size of the TagContext (8193) will be one byte
  // more than limit.
  builder.put(TagKey.create("last"), TagValue.create("last1"));

  TagContext tagContext = builder.build();
  thrown.expect(TagContextSerializationException.class);
  thrown.expectMessage("Size of TagContext exceeds the maximum serialized size ");
  serializer.toByteArray(tagContext);
}
 
Example #3
Source File: TagContextRoundtripTest.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@Test
public void testRoundtrip_TagContextWithMaximumSize() throws Exception {
  TagContextBuilder builder = tagger.emptyBuilder();
  for (int i = 0; i < BinarySerializationUtils.TAGCONTEXT_SERIALIZED_SIZE_LIMIT / 8; i++) {
    // Each tag will be with format {key : "0123", value : "0123"}, so the length of it is 8.
    // Add 1024 tags, the total size should just be 8192.
    String str;
    if (i < 10) {
      str = "000" + i;
    } else if (i < 100) {
      str = "00" + i;
    } else if (i < 1000) {
      str = "0" + i;
    } else {
      str = "" + i;
    }
    builder.put(TagKey.create(str), TagValue.create(str));
  }
  testRoundtripSerialization(builder.build());
}
 
Example #4
Source File: ViewManagerImplTest.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@Test
public void testRecordWithTagsThatDoNotMatchViewData() {
  viewManager.registerView(
      createCumulativeView(VIEW_NAME, MEASURE_DOUBLE, DISTRIBUTION, Arrays.asList(KEY)));
  statsRecorder
      .newMeasureMap()
      .put(MEASURE_DOUBLE, 10.0)
      .record(tagger.emptyBuilder().put(TagKey.create("wrong key"), VALUE).build());
  statsRecorder
      .newMeasureMap()
      .put(MEASURE_DOUBLE, 50.0)
      .record(tagger.emptyBuilder().put(TagKey.create("another wrong key"), VALUE).build());
  ViewData viewData = viewManager.getView(VIEW_NAME);
  assertAggregationMapEquals(
      viewData.getAggregationMap(),
      ImmutableMap.of(
          // Won't record the unregistered tag key, for missing registered keys will use default
          // tag value : "unknown/not set".
          Arrays.asList(RecordUtils.UNKNOWN_TAG_VALUE),
          // Should record stats with default tag value: "KEY" : "unknown/not set".
          createAggregationData(DISTRIBUTION, MEASURE_DOUBLE, 10.0, 50.0)),
      EPSILON);
}
 
Example #5
Source File: View.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs a new {@link View}.
 *
 * @param name the {@link Name} of view. Must be unique.
 * @param description the description of view.
 * @param measure the {@link Measure} to be aggregated by this view.
 * @param aggregation the basic {@link Aggregation} that this view will support.
 * @param columns the {@link TagKey}s that this view will aggregate on. Columns should not contain
 *     duplicates.
 * @param window the {@link AggregationWindow} of view.
 * @return a new {@link View}.
 * @since 0.8
 * @deprecated in favor of {@link #create(Name, String, Measure, Aggregation, List)}.
 */
@Deprecated
public static View create(
    Name name,
    String description,
    Measure measure,
    Aggregation aggregation,
    List<TagKey> columns,
    AggregationWindow window) {
  Utils.checkArgument(
      new HashSet<TagKey>(columns).size() == columns.size(), "Columns have duplicate.");

  List<TagKey> tagKeys = new ArrayList<TagKey>(columns);
  Collections.sort(tagKeys, TAG_KEY_COMPARATOR);
  return new AutoValue_View(
      name, description, measure, aggregation, Collections.unmodifiableList(tagKeys), window);
}
 
Example #6
Source File: BinarySerializationUtils.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
private static Map<TagKey, TagValueWithMetadata> parseTags(ByteBuffer buffer)
    throws TagContextDeserializationException {
  Map<TagKey, TagValueWithMetadata> tags = new HashMap<TagKey, TagValueWithMetadata>();
  int limit = buffer.limit();
  int totalChars = 0; // Here chars are equivalent to bytes, since we're using ascii chars.
  while (buffer.position() < limit) {
    int type = buffer.get();
    if (type == TAG_FIELD_ID) {
      TagKey key = createTagKey(decodeString(buffer));
      TagValue val = createTagValue(key, decodeString(buffer));
      totalChars += key.getName().length();
      totalChars += val.asString().length();
      tags.put(key, TagValueWithMetadata.create(val, METADATA_UNLIMITED_PROPAGATION));
    } else {
      // Stop parsing at the first unknown field ID, since there is no way to know its length.
      // TODO(sebright): Consider storing the rest of the byte array in the TagContext.
      break;
    }
  }
  if (totalChars > TAGCONTEXT_SERIALIZED_SIZE_LIMIT) {
    throw new TagContextDeserializationException(
        "Size of TagContext exceeds the maximum serialized size "
            + TAGCONTEXT_SERIALIZED_SIZE_LIMIT);
  }
  return tags;
}
 
Example #7
Source File: CorrelationContextFormatTest.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@Test
public void roundTrip()
    throws TagContextSerializationException, TagContextDeserializationException {
  Tag[] tags = new Tag[40];
  for (int i = 0; i < tags.length; i++) {
    tags[i] =
        Tag.create(
            TagKey.create(generateRandom(10)),
            TagValue.create(generateRandom(10)),
            METADATA_UNLIMITED_PROPAGATION);
  }
  TagContext tagContext = makeTagContext(tags);
  Map<String, String> carrier = new HashMap<String, String>();
  textFormat.inject(tagContext, carrier, setter);
  TagContext actual = textFormat.extract(carrier, getter);
  assertThat(TagsTestUtil.tagContextToList(actual))
      .containsExactlyElementsIn(TagsTestUtil.tagContextToList(tagContext));
}
 
Example #8
Source File: CorrelationContextFormat.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
private static void decodeTag(String stringTag, Map<TagKey, TagValueWithMetadata> tags) {
  String keyWithValue;
  int firstPropertyIndex = stringTag.indexOf(TAG_PROPERTIES_DELIMITER);
  if (firstPropertyIndex != -1) { // Tag with properties.
    keyWithValue = stringTag.substring(0, firstPropertyIndex);
    // TODO(songya): support decoding tag properties.
  } else { // Tag without properties.
    keyWithValue = stringTag;
  }
  List<String> keyValuePair = TAG_KEY_VALUE_SPLITTER.splitToList(keyWithValue);
  checkArgument(keyValuePair.size() == 2, "Malformed tag " + stringTag);
  TagKey key = TagKey.create(keyValuePair.get(0).trim());
  TagValue value = TagValue.create(keyValuePair.get(1).trim());
  TagValueWithMetadata valueWithMetadata =
      TagValueWithMetadata.create(value, METADATA_UNLIMITED_PROPAGATION);
  tags.put(key, valueWithMetadata);
}
 
Example #9
Source File: TagContextDeserializationTest.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@Test
public void testDeserializeNonConsecutiveDuplicateTags()
    throws TagContextDeserializationException {
  ByteArrayDataOutput output = ByteStreams.newDataOutput();
  output.write(BinarySerializationUtils.VERSION_ID);
  encodeTagToOutput("Key1", "Value1", output);
  encodeTagToOutput("Key2", "Value2", output);
  encodeTagToOutput("Key3", "Value3", output);
  encodeTagToOutput("Key1", "Value1", output);
  encodeTagToOutput("Key2", "Value2", output);
  TagContext expected =
      tagger
          .emptyBuilder()
          .put(TagKey.create("Key1"), TagValue.create("Value1"))
          .put(TagKey.create("Key2"), TagValue.create("Value2"))
          .put(TagKey.create("Key3"), TagValue.create("Value3"))
          .build();
  assertThat(serializer.fromByteArray(output.toByteArray())).isEqualTo(expected);
}
 
Example #10
Source File: TagContextDeserializationTest.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@Test
public void testDeserializeNonConsecutiveDuplicateKeys()
    throws TagContextDeserializationException {
  ByteArrayDataOutput output = ByteStreams.newDataOutput();
  output.write(BinarySerializationUtils.VERSION_ID);
  encodeTagToOutput("Key1", "Value1", output);
  encodeTagToOutput("Key2", "Value2", output);
  encodeTagToOutput("Key3", "Value3", output);
  encodeTagToOutput("Key1", "Value4", output);
  encodeTagToOutput("Key2", "Value5", output);
  TagContext expected =
      tagger
          .emptyBuilder()
          .put(TagKey.create("Key1"), TagValue.create("Value4"))
          .put(TagKey.create("Key2"), TagValue.create("Value5"))
          .put(TagKey.create("Key3"), TagValue.create("Value3"))
          .build();
  assertThat(serializer.fromByteArray(output.toByteArray())).isEqualTo(expected);
}
 
Example #11
Source File: RecordUtils.java    From opencensus-java with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
static List</*@Nullable*/ TagValue> getTagValues(
    Map<? extends TagKey, TagValueWithMetadata> tags, List<? extends TagKey> columns) {
  List</*@Nullable*/ TagValue> tagValues = new ArrayList</*@Nullable*/ TagValue>(columns.size());
  // Record all the measures in a "Greedy" way.
  // Every view aggregates every measure. This is similar to doing a GROUPBY view’s keys.
  for (int i = 0; i < columns.size(); ++i) {
    TagKey tagKey = columns.get(i);
    if (!tags.containsKey(tagKey)) {
      @javax.annotation.Nullable TagValue tagValue = UNKNOWN_TAG_VALUE;
      TagKey[] newKeys = RPC_TAG_MAPPINGS.get(tagKey);
      if (newKeys != null) {
        tagValue = getTagValueForDeprecatedRpcTag(tags, newKeys);
      }
      tagValues.add(tagValue);
    } else {
      tagValues.add(tags.get(tagKey).getTagValue());
    }
  }
  return tagValues;
}
 
Example #12
Source File: AbstractInteropTest.java    From grpc-java with Apache License 2.0 6 votes vote down vote up
private static void checkEndTags(
    MetricsRecord record, String methodName, Status.Code status, boolean clientSide) {
  assertNotNull("record is not null", record);

  TagKey methodNameTagKey = clientSide
      ? RpcMeasureConstants.GRPC_CLIENT_METHOD
      : RpcMeasureConstants.GRPC_SERVER_METHOD;
  TagValue methodNameTag = record.tags.get(methodNameTagKey);
  assertNotNull("method name tagged", methodNameTag);
  assertEquals("method names match", methodName, methodNameTag.asString());

  TagKey statusTagKey = clientSide
      ? RpcMeasureConstants.GRPC_CLIENT_STATUS
      : RpcMeasureConstants.GRPC_SERVER_STATUS;
  TagValue statusTag = record.tags.get(statusTagKey);
  assertNotNull("status tagged", statusTag);
  assertEquals(status.toString(), statusTag.asString());
}
 
Example #13
Source File: AbstractInteropTest.java    From grpc-java with Apache License 2.0 5 votes vote down vote up
private static void checkStartTags(MetricsRecord record, String methodName, boolean clientSide) {
  assertNotNull("record is not null", record);

  TagKey methodNameTagKey = clientSide
      ? RpcMeasureConstants.GRPC_CLIENT_METHOD
      : RpcMeasureConstants.GRPC_SERVER_METHOD;
  TagValue methodNameTag = record.tags.get(methodNameTagKey);
  assertNotNull("method name tagged", methodNameTag);
  assertEquals("method names match", methodName, methodNameTag.asString());
}
 
Example #14
Source File: TagsBenchmark.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Setup
public void setup() throws Exception {
  StringBuilder builder = new StringBuilder(size);
  // build a string with characters from 'a' to 'z'
  for (int i = 0; i < size; i++) {
    builder.append((char) (97 + i % 26));
  }
  input = builder.toString();
  tagKey = TagKey.create(input);
  tagValue = TagValue.create(input);
}
 
Example #15
Source File: TagsBenchmarksUtil.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
/** Creates an array of TagKeys of 'size' with 'name' prefix. */
@VisibleForTesting
public static TagKey[] createTagKeys(int size, String name) {
  TagKey[] keys = new TagKey[size];
  for (int i = 0; i < size; i++) {
    keys[i] = TagKey.create(name + i);
  }
  return keys;
}
 
Example #16
Source File: StatsBenchmarksUtil.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
private static View[] createViews(
    int size, Measure[] measures, Aggregation aggregation, TagKey... keys) {
  View[] views = new View[size];
  for (int i = 0; i < size; i++) {
    views[i] = createView(measures[i].getName(), measures[i], aggregation, keys);
  }
  return views;
}
 
Example #17
Source File: ViewTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void preventDuplicateColumns() {
  TagKey key1 = TagKey.create("duplicate");
  TagKey key2 = TagKey.create("duplicate");
  thrown.expect(IllegalArgumentException.class);
  thrown.expectMessage("Columns have duplicate.");
  View.create(NAME, DESCRIPTION, MEASURE, MEAN, Arrays.asList(key1, key2));
}
 
Example #18
Source File: CorrelationContextFormatTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void inject_TooManyTags() throws TagContextSerializationException {
  Tag[] tags = new Tag[CorrelationContextFormat.MAX_NUMBER_OF_TAGS + 1];
  for (int i = 0; i < tags.length; i++) {
    tags[i] =
        Tag.create(
            TagKey.create("k" + i), TagValue.create("v" + i), METADATA_UNLIMITED_PROPAGATION);
  }
  TagContext tagContext = makeTagContext(tags);
  Map<String, String> carrier = new HashMap<String, String>();
  thrown.expect(TagContextSerializationException.class);
  textFormat.inject(tagContext, carrier, setter);
}
 
Example #19
Source File: RecordUtilsTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetTagValues() {
  List<TagKey> columns = Arrays.asList(CALLER, METHOD, ORIGINATOR);
  Map<TagKey, TagValueWithMetadata> tags =
      ImmutableMap.of(CALLER, CALLER_V_WITH_MD, METHOD, METHOD_V_WITH_MD);

  assertThat(RecordUtils.getTagValues(tags, columns))
      .containsExactly(CALLER_V, METHOD_V, RecordUtils.UNKNOWN_TAG_VALUE)
      .inOrder();
}
 
Example #20
Source File: CorrelationContextFormatTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void inject_SizeTooLarge() throws TagContextSerializationException {
  Tag[] tags = new Tag[40];
  for (int i = 0; i < tags.length; i++) {
    tags[i] =
        Tag.create(
            TagKey.create(generateRandom(240)),
            TagValue.create(generateRandom(240)),
            METADATA_UNLIMITED_PROPAGATION);
  }
  TagContext tagContext = makeTagContext(tags);
  Map<String, String> carrier = new HashMap<String, String>();
  thrown.expect(TagContextSerializationException.class);
  textFormat.inject(tagContext, carrier, setter);
}
 
Example #21
Source File: TagContextDeserializationTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void testDeserializeDuplicateKeys() throws TagContextDeserializationException {
  ByteArrayDataOutput output = ByteStreams.newDataOutput();
  output.write(BinarySerializationUtils.VERSION_ID);
  encodeTagToOutput("Key1", "Value1", output);
  encodeTagToOutput("Key1", "Value2", output);
  TagContext expected =
      tagger.emptyBuilder().put(TagKey.create("Key1"), TagValue.create("Value2")).build();
  assertThat(serializer.fromByteArray(output.toByteArray())).isEqualTo(expected);
}
 
Example #22
Source File: RecordUtils.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
static Map<TagKey, TagValueWithMetadata> getTagMap(TagContext ctx) {
  if (ctx instanceof TagMapImpl) {
    return ((TagMapImpl) ctx).getTags();
  }
  Map<TagKey, TagValueWithMetadata> tags = Maps.newHashMap();
  for (Iterator<Tag> i = InternalUtils.getTags(ctx); i.hasNext(); ) {
    Tag tag = i.next();
    tags.put(tag.getKey(), TagValueWithMetadata.create(tag.getValue(), tag.getTagMetadata()));
  }
  return tags;
}
 
Example #23
Source File: RecordUtils.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@javax.annotation.Nullable
private static TagValue getTagValueForDeprecatedRpcTag(
    Map<? extends TagKey, TagValueWithMetadata> tags, TagKey[] newKeys) {
  for (TagKey newKey : newKeys) {
    TagValueWithMetadata valueWithMetadata = tags.get(newKey);
    if (valueWithMetadata != null) {
      return valueWithMetadata.getTagValue();
    }
  }
  return UNKNOWN_TAG_VALUE;
}
 
Example #24
Source File: RecordUtilsTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetTagValues_MapDeprecatedRpcTag_WithServerTag() {
  List<TagKey> columns = Arrays.asList(RecordUtils.RPC_STATUS, RecordUtils.RPC_METHOD);
  Map<TagKey, TagValueWithMetadata> tags =
      ImmutableMap.of(
          RecordUtils.GRPC_SERVER_METHOD, METHOD_V_WITH_MD,
          RecordUtils.GRPC_SERVER_STATUS, STATUS_V_WITH_MD);

  assertThat(RecordUtils.getTagValues(tags, columns))
      .containsExactly(STATUS_V, METHOD_V)
      .inOrder();
}
 
Example #25
Source File: CorrelationContextFormat.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Override
public <C /*>>> extends @NonNull Object*/> TagContext extract(C carrier, Getter<C> getter)
    throws TagContextDeserializationException {
  checkNotNull(carrier, "carrier");
  checkNotNull(getter, "getter");
  if (State.DISABLED.equals(state.getInternal())) {
    return TagMapImpl.EMPTY;
  }

  @Nullable String correlationContext = getter.get(carrier, CORRELATION_CONTEXT);
  if (correlationContext == null) {
    throw new TagContextDeserializationException(CORRELATION_CONTEXT + " not present.");
  }
  try {
    if (correlationContext.isEmpty()) {
      return TagMapImpl.EMPTY;
    }
    Map<TagKey, TagValueWithMetadata> tags = new HashMap<>();
    List<String> stringTags = TAG_SPLITTER.splitToList(correlationContext);
    for (String stringTag : stringTags) {
      decodeTag(stringTag, tags);
    }
    return new TagMapImpl(tags);
  } catch (IllegalArgumentException e) {
    throw new TagContextDeserializationException("Invalid TagContext: " + correlationContext, e);
  }
}
 
Example #26
Source File: StatsTestUtils.java    From grpc-java with Apache License 2.0 5 votes vote down vote up
@Override
protected Iterator<Tag> getIterator() {
  return Iterators.transform(
      tags.entrySet().iterator(),
      new Function<Map.Entry<TagKey, TagValue>, Tag>() {
        @Override
        public Tag apply(@Nullable Map.Entry<TagKey, TagValue> entry) {
          return Tag.create(entry.getKey(), entry.getValue(), METADATA_PROPAGATING);
        }
      });
}
 
Example #27
Source File: BinarySerializationUtils.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
private static final TagValue createTagValue(TagKey key, String value)
    throws TagContextDeserializationException {
  try {
    return TagValue.create(value);
  } catch (IllegalArgumentException e) {
    throw new TagContextDeserializationException(
        "Invalid tag value for key " + key + ": " + value, e);
  }
}
 
Example #28
Source File: RecordUtilsTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetTagValues_WithNewTags() {
  List<TagKey> columns =
      Arrays.asList(RecordUtils.GRPC_CLIENT_METHOD, RecordUtils.GRPC_SERVER_METHOD);
  Map<TagKey, TagValueWithMetadata> tags =
      ImmutableMap.of(
          RecordUtils.GRPC_SERVER_METHOD, METHOD_V_WITH_MD,
          RecordUtils.GRPC_CLIENT_METHOD, METHOD_V_2_WITH_MD);

  assertThat(RecordUtils.getTagValues(tags, columns))
      .containsExactly(METHOD_V_2, METHOD_V)
      .inOrder();
}
 
Example #29
Source File: RecordUtilsTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetTagValues_WithOldMethodTag() {
  List<TagKey> columns = Arrays.asList(RecordUtils.RPC_METHOD);
  Map<TagKey, TagValueWithMetadata> tags =
      ImmutableMap.of(
          RecordUtils.GRPC_SERVER_METHOD, METHOD_V_WITH_MD,
          RecordUtils.GRPC_CLIENT_METHOD, METHOD_V_2_WITH_MD,
          RecordUtils.RPC_METHOD, METHOD_V_3_WITH_MD);

  // When the old "method" tag is set, it always takes precedence.
  assertThat(RecordUtils.getTagValues(tags, columns)).containsExactly(METHOD_V_3).inOrder();
}
 
Example #30
Source File: RecordUtilsTest.java    From opencensus-java with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetTagValues_MapDeprecatedRpcTag_PreferClientTag() {
  List<TagKey> columns = Arrays.asList(RecordUtils.RPC_STATUS, RecordUtils.RPC_METHOD);
  Map<TagKey, TagValueWithMetadata> tags =
      ImmutableMap.of(
          RecordUtils.GRPC_SERVER_METHOD, METHOD_V_WITH_MD,
          RecordUtils.GRPC_SERVER_STATUS, STATUS_V_WITH_MD,
          RecordUtils.GRPC_CLIENT_METHOD, METHOD_V_2_WITH_MD,
          RecordUtils.GRPC_CLIENT_STATUS, STATUS_V_2_WITH_MD);

  // When both client and server new tags are present, client values take precedence.
  assertThat(RecordUtils.getTagValues(tags, columns))
      .containsExactly(STATUS_V_2, METHOD_V_2)
      .inOrder();
}