Skip to content

Commit

Permalink
[exporter/azuremonitor] use generated status header (#22082)
Browse files Browse the repository at this point in the history
This PR updates the component to generate the status table using mdatagen. Questions to the code owners:

Linked issue: #21213

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed May 18, 2023
1 parent 851e6f7 commit 7b7544f
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 19 deletions.
19 changes: 10 additions & 9 deletions exporter/azuremonitorexporter/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Azure Monitor Exporter

| Status | |
|--------------------------|-----------------------|
| Stability | [beta] |
| Supported pipeline types | logs, traces, metrics |
| Distributions | [contrib], [observiq] |
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [beta]: traces, metrics, logs |
| Distributions | [contrib], [observiq] |

[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[observiq]: https://github.com/observIQ/observiq-otel-collector
<!-- end autogenerated section -->

This exporter sends logs, traces and metrics to [Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/).

Expand Down Expand Up @@ -75,7 +80,3 @@ This exporter saves log records to Application Insights `traces` table.
### Metrics

This exporter saves metrics to Application Insights `customMetrics` table.

[beta]:https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[observiq]: https://github.com/observIQ/observiq-otel-collector
6 changes: 4 additions & 2 deletions exporter/azuremonitorexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/confmap/confmaptest"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuremonitorexporter/internal/metadata"
)

func TestLoadConfig(t *testing.T) {
Expand All @@ -26,11 +28,11 @@ func TestLoadConfig(t *testing.T) {
}{

{
id: component.NewIDWithName(typeStr, ""),
id: component.NewIDWithName(metadata.Type, ""),
expected: createDefaultConfig(),
},
{
id: component.NewIDWithName(typeStr, "2"),
id: component.NewIDWithName(metadata.Type, "2"),
expected: &Config{
Endpoint: defaultEndpoint,
InstrumentationKey: "abcdefg",
Expand Down
16 changes: 8 additions & 8 deletions exporter/azuremonitorexporter/factory.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

package azuremonitorexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuremonitorexporter"

import (
Expand All @@ -12,13 +14,11 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuremonitorexporter/internal/metadata"
)

const (
// The value of "type" key in configuration.
typeStr = "azuremonitor"
// The stability level of the exporter.
stability = component.StabilityLevelBeta
defaultEndpoint = "https://dc.services.visualstudio.com/v2/track"
)

Expand All @@ -30,11 +30,11 @@ var (
func NewFactory() exporter.Factory {
f := &factory{}
return exporter.NewFactory(
typeStr,
metadata.Type,
createDefaultConfig,
exporter.WithTraces(f.createTracesExporter, stability),
exporter.WithLogs(f.createLogsExporter, stability),
exporter.WithMetrics(f.createMetricsExporter, stability))
exporter.WithTraces(f.createTracesExporter, metadata.TracesStability),
exporter.WithLogs(f.createLogsExporter, metadata.LogsStability),
exporter.WithMetrics(f.createMetricsExporter, metadata.MetricsStability))
}

// Implements the interface from go.opentelemetry.io/collector/exporter/factory.go
Expand Down

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

7 changes: 7 additions & 0 deletions exporter/azuremonitorexporter/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: azuremonitor

status:
class: exporter
stability:
beta: [traces, metrics, logs]
distributions: [contrib, observiq]

0 comments on commit 7b7544f

Please sign in to comment.