Skip to content

Commit

Permalink
[receiver/nginx] use generated status header
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:

Does this component require any of the standard warnings? See list: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/standard-warnings.md

See related issue: open-telemetry#19172

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed May 5, 2023
1 parent 702ea8a commit 20ae511
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
17 changes: 9 additions & 8 deletions receiver/nginxreceiver/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Nginx Receiver

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

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

This receiver can fetch stats from a Nginx instance using a mod_status endpoint.

Expand Down Expand Up @@ -46,6 +50,3 @@ receivers:
The full list of settings exposed for this receiver are documented [here](./config.go)
with detailed sample configurations [here](./testdata/config.yaml).
[beta]:https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
5 changes: 2 additions & 3 deletions receiver/nginxreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ import (
)

const (
typeStr = "nginx"
stability = component.StabilityLevelBeta
typeStr = "nginx"
)

// NewFactory creates a factory for nginx receiver.
func NewFactory() receiver.Factory {
return receiver.NewFactory(
typeStr,
createDefaultConfig,
receiver.WithMetrics(createMetricsReceiver, stability))
receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability))
}

func createDefaultConfig() component.Config {
Expand Down
12 changes: 12 additions & 0 deletions receiver/nginxreceiver/internal/metadata/generated_status.go

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

6 changes: 6 additions & 0 deletions receiver/nginxreceiver/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
type: nginxreceiver

status:
class: receiver
stability:
beta: [metrics]
distributions: [contrib]

attributes:
state:
description: The state of a connection
Expand Down

0 comments on commit 20ae511

Please sign in to comment.