Skip to content

Commit 6173862

Browse files
[pkg/translator/azure] Map application-defined properties (#35402)
**Description:** #33583 introduced support for traces in Azure Event Hub receiver. However, application-defined properties have not been mapped. This PR fixes this and adds the mapping for properties. **Link to tracking Issue:** **Testing:** **Documentation:** cc @deepan10 --------- Co-authored-by: joegoldman2 <[email protected]> Co-authored-by: Sean Marciniak <[email protected]>
1 parent 3105f18 commit 6173862

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: azuretranslator
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Map application-defined properties for trace signals
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [35402]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

pkg/translator/azure/resources_to_traces.go

+6
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ func (r TracesUnmarshaler) UnmarshalTraces(buf []byte) (ptrace.Traces, error) {
147147
span.Attributes().PutStr("http.scheme", scheme)
148148
span.Attributes().PutStr("http.method", azureTrace.Properties["HTTP Method"])
149149

150+
for key, value := range azureTrace.Properties {
151+
if key != "HTTP Method" { // HTTP Method is already mapped to http.method
152+
span.Attributes().PutStr(key, value)
153+
}
154+
}
155+
150156
span.SetKind(ptrace.SpanKindServer)
151157
span.SetName(azureTrace.Name)
152158
span.SetStartTimestamp(nanos)

0 commit comments

Comments
 (0)