Skip to content

Commit

Permalink
[chore] [exporter/alertmanagerexporter] Add exporter to components (#…
Browse files Browse the repository at this point in the history
…30230)

Add Alertmanager Exporter to Components
Third PR - Update buildconfig and components

**Link to tracking Issue:**
[#23659](#23569)

**Testing:** Unit tests for exporter

**Documentation:** Readme and Sample Configs to use Alertmanager
exporter

---------

Co-authored-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
mcube8 and Alex Boten authored Jan 17, 2024
1 parent 206e1a8 commit 2c7c039
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .chloggen/alertmanagerexporter_add_builder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'new_component'

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: alertmanagerexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add Alertmanager exporter to builder config"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [23569]

# (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:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ exporters:
- gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.92.1-0.20240117180253-4371e14440ee
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.92.1-0.20240117180253-4371e14440ee
- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.92.1-0.20240117180253-4371e14440ee
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alertmanagerexporter v0.92.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.92.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.92.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter v0.92.0
Expand Down Expand Up @@ -312,6 +313,7 @@ replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver => ../../receiver/redisreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension => ../../extension/basicauthextension
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influxdbexporter => ../../exporter/influxdbexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alertmanagerexporter => ../../exporter/alertmanagerexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter => ../../exporter/alibabacloudlogserviceexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker => ../../internal/docker
Expand Down
2 changes: 2 additions & 0 deletions cmd/otelcontribcol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions cmd/otelcontribcol/exporters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"go.opentelemetry.io/collector/exporter/otlpexporter"
"go.opentelemetry.io/collector/exporter/otlphttpexporter"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alertmanagerexporter"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter"
Expand Down Expand Up @@ -264,6 +265,22 @@ func TestDefaultExporters(t *testing.T) {
},
skipLifecycle: true,
},
{
exporter: "alertmanager",
getConfigFn: func() component.Config {
cfg := expFactories["alertmanager"].CreateDefaultConfig().(*alertmanagerexporter.Config)
cfg.HTTPClientSettings = confighttp.HTTPClientSettings{
Endpoint: "http://" + endpoint,
}
cfg.GeneratorURL = "opentelemetry-collector"
cfg.DefaultSeverity = "info"
// disable queue/retry to validate passing the test data synchronously
cfg.QueueSettings.Enabled = false
cfg.BackoffConfig.Enabled = false
return cfg
},
expectConsumeErr: true,
},
{
exporter: "alibabacloud_logservice",
getConfigFn: func() component.Config {
Expand Down
3 changes: 3 additions & 0 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector v0.92.0
github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector v0.92.0
github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.92.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alertmanagerexporter v0.92.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.92.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter v0.92.0
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter v0.92.0
Expand Down Expand Up @@ -919,6 +920,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/basi

replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influxdbexporter => ../../exporter/influxdbexporter

replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alertmanagerexporter => ../../exporter/alertmanagerexporter

replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter => ../../exporter/alibabacloudlogserviceexporter

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger
Expand Down
2 changes: 0 additions & 2 deletions exporter/alertmanagerexporter/generated_component_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion exporter/alertmanagerexporter/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ status:
active: [jpkrohling, sokoide, mcube8]

tests:
config:
config:
endpoint: http://localhost:0
generator_url: opentelemetry-collector
severity: info
sending_queue:
enabled: false
retry_on_failure:
enabled: false
expect_consumer_error: true

0 comments on commit 2c7c039

Please sign in to comment.