Skip to content

Commit 4ddee21

Browse files
dev-tools: add profiling special case for edot (#10143)
* dev-tools: add profiling special case for edot #9888 added profiling as an receiver to EDOT. Fix tooling to add this receiver to autogenerated list of components for EDOT. Signed-off-by: Florian Lehner <[email protected]> * fixup ``` Error: dev-tools/mage/otel/deps.go:52:3: QF1003: could use tagged switch on dependency.ComponentType (staticcheck) if dependency.ComponentType == "connector" { ^ 1 issues: * staticcheck: 1 ``` Signed-off-by: Florian Lehner <[email protected]> * Update dev-tools/mage/otel/deps.go Co-authored-by: Christos Kalkanis <[email protected]> --------- Signed-off-by: Florian Lehner <[email protected]> Co-authored-by: Christos Kalkanis <[email protected]>
1 parent ae7ce8a commit 4ddee21

File tree

4 files changed

+53
-5
lines changed

4 files changed

+53
-5
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: bug-fix
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: add special case handling for profiling in EDOT
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: "elastic-agent"
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

dev-tools/mage/otel/deps.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,23 @@ func GetOtelDependencies(goModPath string) (*OtelDependencies, error) {
4040
}
4141
pathToDep[req.Mod.Path] = dependency
4242

43-
if dependency.ComponentType == "connector" {
43+
// Special case: treat go.opentelemetry.io/ebpf-profiler as receiver
44+
if req.Mod.Path == "go.opentelemetry.io/ebpf-profiler" {
45+
dependency.ComponentType = "receiver"
46+
dependency.Name = "profiling"
47+
dependency.Link = fmt.Sprintf("https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/%s/README.md", dependency.Version)
48+
}
49+
50+
switch dependency.ComponentType {
51+
case "connector":
4452
connectors = append(connectors, dependency)
45-
} else if dependency.ComponentType == "exporter" {
53+
case "exporter":
4654
exporters = append(exporters, dependency)
47-
} else if dependency.ComponentType == "extension" {
55+
case "extension":
4856
extensions = append(extensions, dependency)
49-
} else if dependency.ComponentType == "processor" {
57+
case "processor":
5058
processors = append(processors, dependency)
51-
} else if dependency.ComponentType == "receiver" {
59+
case "receiver":
5260
receivers = append(receivers, dependency)
5361
}
5462
}

dev-tools/mage/otel/deps_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ require (
3333
go.opentelemetry.io/collector/extension/memorylimiterextension v0.119.0
3434
go.opentelemetry.io/collector/processor/batchprocessor v0.119.0
3535
go.opentelemetry.io/collector/receiver/otlpreceiver v0.119.0
36+
go.opentelemetry.io/ebpf-profiler v0.0.202536
3637
golang.org/x/crypto v0.36.0
3738
github.com/elastic/elastic-agent-autodiscover v0.9.0
3839
)
@@ -130,6 +131,12 @@ replace (
130131
Version: "v0.119.0",
131132
Link: "https://github.com/open-telemetry/opentelemetry-collector/blob/receiver/otlpreceiver/v0.119.0/receiver/otlpreceiver/README.md",
132133
},
134+
{
135+
ComponentType: "receiver",
136+
Name: "profiling",
137+
Version: "v0.0.202536",
138+
Link: "https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/v0.0.202536/README.md",
139+
},
133140
{
134141
ComponentType: "receiver",
135142
Name: "prometheusreceiver",

internal/pkg/otel/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ This section provides a summary of components included in the Elastic Distributi
5454
| [nopreceiver](https://github.com/open-telemetry/opentelemetry-collector/blob/receiver/nopreceiver/v0.135.0/receiver/nopreceiver/README.md) | v0.135.0 |
5555
| [otlpreceiver](https://github.com/open-telemetry/opentelemetry-collector/blob/receiver/otlpreceiver/v0.135.0/receiver/otlpreceiver/README.md) | v0.135.0 |
5656
| [postgresqlreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/receiver/postgresqlreceiver/v0.135.0/receiver/postgresqlreceiver/README.md) | v0.135.0 |
57+
| [profiling](https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/v0.0.202536/README.md) | v0.0.202536 |
5758
| [prometheusreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/receiver/prometheusreceiver/v0.135.0/receiver/prometheusreceiver/README.md) | v0.135.0 |
5859
| [receivercreator](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/receiver/receivercreator/v0.135.0/receiver/receivercreator/README.md) | v0.135.0 |
5960
| [redisreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/receiver/redisreceiver/v0.135.0/receiver/redisreceiver/README.md) | v0.135.0 |

0 commit comments

Comments
 (0)