You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tags.TryGetAndRemoveTag<string>(["rpc.service"],outvarservice);// deprecated attribute, rpc.method includes this information in the format /service/method, but some instrumentation may still use this tag so we'll look for it as a fallback
// Only generate unscoped metric for response with CAT headers because segments should only produce a single scoped metric and the CAT metric is more interesting than the external segment metric.
// Used to store _small_ amounts of data for use when creating segment data or other attributes. This is not intended to be a general purpose storage mechanism and should not be used to store large objects or large amounts of data.
Copy file name to clipboardExpand all lines: src/Agent/NewRelic/Agent/Extensions/NewRelic.Agent.Extensions/Api/Experimental/ISegmentExperimental.cs
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
// Copyright 2020 New Relic, Inc. All rights reserved.
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
+
usingNewRelic.Agent.Extensions.Api.Experimental;
5
+
4
6
namespaceNewRelic.Agent.Api.Experimental;
5
7
6
8
/// <summary>
@@ -54,4 +56,25 @@ public interface ISegmentExperimental
54
56
/// Will be true if a relative end time has been set on the segment. In most situations, this is only set when a segment is ended.
55
57
/// </summary>
56
58
boolIsDone{get;}
57
-
}
59
+
60
+
/// <summary>
61
+
/// Returns the activity associated with the segment.
62
+
/// </summary>
63
+
/// <returns></returns>
64
+
INewRelicActivityGetActivity();
65
+
66
+
/// <summary>
67
+
/// Add object to the segment's data cache with the specified key.
68
+
/// This is intended for use in cases where you need to store some data during the execution of a segment that will be used when creating the segment data or attributes.
69
+
/// This should not be used as a general purpose storage mechanism and should not be used to store large objects or large amounts of data.
70
+
/// This will overwrite any existing value in the cache with the same key, so it should be used with unique keys to avoid collisions.
71
+
/// It is the caller's responsibility to manage the keys and ensure they are unique within the context of a segment.
72
+
///
73
+
/// Notes:
74
+
/// Null keys are not allowed and will be ignored. If a null key is passed to this method, the method will return without adding anything to the cache.
75
+
/// Null values are allowed and will be stored in the cache. If a null value is added to the cache, it will overwrite any existing value with the same key, and a subsequent retrieval of that key from the cache will return null.
// Where we need to find the previous segment or activity and if it is a gRPC segment/activity, we need to set the server.address and server.port attributes on the segment/activity.
63
+
// After we do this, we need to no-op this so that we only create a single external segment.
64
+
// This is required for distributed tracing to work properly for gRPC requests.
65
+
// No segment has been created in this wrapper at this point, so this should be the parent.
0 commit comments