Skip to content

Commit

Permalink
get servicename from daemonset if possible (open-telemetry#2013)
Browse files Browse the repository at this point in the history
* get servicename from daemonset if possible

Signed-off-by: Angelo Poerio <[email protected]>

* added changelog

Signed-off-by: Angelo Poerio <[email protected]>

---------

Signed-off-by: Angelo Poerio <[email protected]>
  • Loading branch information
angelopoerio authored Aug 14, 2023
1 parent ed0fb56 commit d8ffd1e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .chloggen/servicename-daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Daemonsets can be instrumented so the generated servicename should use their name for better discoverability"

# One or more tracking issues related to the change
issues: [2015]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
3 changes: 3 additions & 0 deletions pkg/instrumentation/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ func chooseServiceName(pod corev1.Pod, resources map[string]string, index int) s
if name := resources[string(semconv.K8SStatefulSetNameKey)]; name != "" {
return name
}
if name := resources[string(semconv.K8SDaemonSetNameKey)]; name != "" {
return name
}
if name := resources[string(semconv.K8SJobNameKey)]; name != "" {
return name
}
Expand Down

0 comments on commit d8ffd1e

Please sign in to comment.