Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Provide a new Tag for PEER_HOST_IPV4
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-sheng committed Sep 17, 2017
1 parent 767f716 commit b5ae56f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2016-2017 The OpenTracing Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package io.opentracing.tag;

import io.opentracing.BaseSpan;

public class IntOrStringTag extends IntTag {
public IntOrStringTag(String key) {
super(key);
}

public void set(BaseSpan<?> span, String tagValue) {
span.setTag(super.key, tagValue);
}
}
2 changes: 1 addition & 1 deletion opentracing-api/src/main/java/io/opentracing/tag/Tags.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private Tags() {
/**
* PEER_HOST_IPV4 records IPv4 host address of the peer.
*/
public static final IntTag PEER_HOST_IPV4 = new IntTag("peer.ipv4");
public static final IntOrStringTag PEER_HOST_IPV4 = new IntOrStringTag("peer.ipv4");

/**
* PEER_HOST_IPV6 records the IPv6 host address of the peer.
Expand Down

0 comments on commit b5ae56f

Please sign in to comment.