Skip to content

Commit

Permalink
Add debug exporter to component factory list (#2855)
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
  • Loading branch information
Aneurysm9 authored Sep 26, 2024
1 parent 418fcc6 commit 0371c29
Show file tree
Hide file tree
Showing 26 changed files with 940 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This table represents the supported components of the ADOT Collector. The highli
| | [groupbytraceprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/groupbytraceprocessor) | [kafka](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/kafkaexporter) | |
| | [tailsamplingprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor) | [loadbalancingexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/loadbalancingexporter) | |
| | [k8sattributesprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/k8sattributesprocessor) | [awscloudwatchlogsexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/awscloudwatchlogsexporter) | |
| | | [debugexporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter) | |


Besides the components that interact with telemetry signals directly from the previous table, there is also support to the following confmap providers:
Expand Down
6 changes: 3 additions & 3 deletions config/ecs/otel-instance-metrics-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ exporters:
- instance_cpu_limit
- instance_memory_working_set
- instance_memory_limit
logging:
loglevel: debug
debug:
verbosity: detailed
service:
pipelines:
metrics:
receivers: [awscontainerinsightreceiver]
processors: [batch/metrics]
exporters: [awsemf,logging]
exporters: [awsemf,debug]
extensions: [health_check]
4 changes: 2 additions & 2 deletions config/eks/prometheus/config-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ exporters:
- label_names:
- pod_name
regex: "^redis-instance$"
logging:
loglevel: debug
debug:
verbosity: detailed

extensions:
pprof:
Expand Down
4 changes: 2 additions & 2 deletions examples/docker/config-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ processors:
batch:

exporters:
logging:
loglevel: debug
debug:
verbosity: detailed
awsxray:
region: 'us-west-2'
awsemf:
Expand Down
8 changes: 4 additions & 4 deletions examples/ecs/aws-prometheus/ecs-ec2-adot-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ exporters:
endpoint: {{endpoint}}
auth:
authenticator: sigv4auth
logging:
loglevel: debug
debug:
verbosity: detailed
extensions:
health_check:
pprof:
Expand All @@ -47,8 +47,8 @@ service:
pipelines:
metrics:
receivers: [prometheus]
exporters: [logging, prometheusremotewrite]
exporters: [debug, prometheusremotewrite]
metrics/ecs:
receivers: [awsecscontainermetrics]
processors: [filter]
exporters: [logging, prometheusremotewrite]
exporters: [debug, prometheusremotewrite]
8 changes: 4 additions & 4 deletions examples/ecs/aws-prometheus/ecs-fargate-adot-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ exporters:
endpoint: {{endpoint}}
auth:
authenticator: sigv4auth
logging:
loglevel: debug
debug:
verbosity: detailed
extensions:
health_check:
pprof:
Expand All @@ -47,8 +47,8 @@ service:
pipelines:
metrics:
receivers: [prometheus]
exporters: [logging, prometheusremotewrite]
exporters: [debug, prometheusremotewrite]
metrics/ecs:
receivers: [awsecscontainermetrics]
processors: [filter]
exporters: [logging, prometheusremotewrite]
exporters: [debug, prometheusremotewrite]
6 changes: 3 additions & 3 deletions examples/eks/aws-prometheus/prometheus-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ data:
auth:
authenticator: sigv4auth
namespace: "adot"
logging:
loglevel: debug
debug:
verbosity: detailed
extensions:
health_check:
Expand All @@ -66,7 +66,7 @@ data:
pipelines:
metrics:
receivers: [prometheus]
exporters: [logging, prometheusremotewrite]
exporters: [debug, prometheusremotewrite]
---
# create adot-col service account and role binding
apiVersion: v1
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ require (
go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.109.0
go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.109.0
go.opentelemetry.io/collector/exporter v0.109.0
go.opentelemetry.io/collector/exporter/debugexporter v0.109.0
go.opentelemetry.io/collector/exporter/loggingexporter v0.109.0
go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0
go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,8 @@ go.opentelemetry.io/collector/consumer/consumertest v0.109.0 h1:v4w9G2MXGJ/eabCm
go.opentelemetry.io/collector/consumer/consumertest v0.109.0/go.mod h1:lECt0qOrx118wLJbGijtqNz855XfvJv0xx9GSoJ8qSE=
go.opentelemetry.io/collector/exporter v0.109.0 h1:LsZ8/EB8cYvdgap3a8HWCEHYpVyH9A4d53Hy0W6n9KY=
go.opentelemetry.io/collector/exporter v0.109.0/go.mod h1:yk+qAB1ZJYoUYretkzbNt/onpy/VyQdTpPhvIbyh3Us=
go.opentelemetry.io/collector/exporter/debugexporter v0.109.0 h1:w/bKcIFy5HwjbtjyLtZ8lcKfKUs+E2o8Dk8qQcJrzpI=
go.opentelemetry.io/collector/exporter/debugexporter v0.109.0/go.mod h1:KN7xarQB/PgxQ0LazfWtx/ODmRVFNIoFFuWJWRZl2+k=
go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0 h1:px+iViqF0JB6+COJL6cTSa0HLpJRNlPmFUA6zjOCKMk=
go.opentelemetry.io/collector/exporter/exporterprofiles v0.109.0/go.mod h1:Zs5z/fdsRN3v9mChU2aYNGzUAJgY+2D+T7ZRGiZ3lmY=
go.opentelemetry.io/collector/exporter/loggingexporter v0.109.0 h1:AXcQt90JHLhd4ZsQhPcCm3gbduttqPTRHCAEdFNslW8=
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestGetMapProviderContainer(t *testing.T) {
const expectedEndpoint = "0.0.0.0:1777"
t.Setenv("PPROF_ENDPOINT", expectedEndpoint)

t.Setenv(envKey, "extensions:\n health_check:\n pprof:\n endpoint: '${PPROF_ENDPOINT}'\nreceivers:\n otlp:\n protocols:\n grpc:\n endpoint: 0.0.0.0:4317\nprocessors:\n batch:\nexporters:\n logging:\n loglevel: debug\n awsxray:\n local_mode: true\n region: 'us-west-2'\n awsemf:\n region: 'us-west-2'\nservice:\n pipelines:\n traces:\n receivers: [otlp]\n exporters: [logging,awsxray]\n metrics:\n receivers: [otlp]\n exporters: [awsemf]\n extensions: [pprof]")
t.Setenv(envKey, "extensions:\n health_check:\n pprof:\n endpoint: '${PPROF_ENDPOINT}'\nreceivers:\n otlp:\n protocols:\n grpc:\n endpoint: 0.0.0.0:4317\nprocessors:\n batch:\nexporters:\n debug:\n verbosity: detailed\n awsxray:\n local_mode: true\n region: 'us-west-2'\n awsemf:\n region: 'us-west-2'\nservice:\n pipelines:\n traces:\n receivers: [otlp]\n exporters: [debug,awsxray]\n metrics:\n receivers: [otlp]\n exporters: [awsemf]\n extensions: [pprof]")

factories, _ := defaultcomponents.Components()
provider, err := otelcol.NewConfigProvider(GetConfigProviderSettings(Flags(featuregate.NewRegistry())))
Expand Down
2 changes: 2 additions & 0 deletions pkg/defaultcomponents/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/debugexporter"
"go.opentelemetry.io/collector/exporter/loggingexporter"
"go.opentelemetry.io/collector/exporter/otlpexporter"
"go.opentelemetry.io/collector/exporter/otlphttpexporter"
Expand Down Expand Up @@ -158,6 +159,7 @@ func Components() (otelcol.Factories, error) {
prometheusexporter.NewFactory(),
fileexporter.NewFactory(),
kafkaexporter.NewFactory(),
debugexporter.NewFactory(),
loggingexporter.NewFactory(),
otlpexporter.NewFactory(),
otlphttpexporter.NewFactory(),
Expand Down
3 changes: 2 additions & 1 deletion pkg/defaultcomponents/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

const (
exportersCount = 15
exportersCount = 16
receiversCount = 10
extensionsCount = 8
processorCount = 15
Expand All @@ -41,6 +41,7 @@ func TestComponents(t *testing.T) {
assert.NotNil(t, exporters[component.MustNewType("awsxray")])
assert.NotNil(t, exporters[component.MustNewType("awsemf")])
// core exporters
assert.NotNil(t, exporters[component.MustNewType("debug")])
assert.NotNil(t, exporters[component.MustNewType("logging")])
assert.NotNil(t, exporters[component.MustNewType("otlp")])
assert.NotNil(t, exporters[component.MustNewType("otlphttp")])
Expand Down
Loading

0 comments on commit 0371c29

Please sign in to comment.