#### Description
This PR adds support in mdatagen for defining semantic conventions
references for attributes.
Updating your attribute in `metadata.yaml`:
```yaml
attributes:
state:
description: Breakdown of memory usage by type.
type: string
enum: [buffered, cached, inactive, free, slab_reclaimable, slab_unreclaimable, used]
semantic_convention:
ref: system.md#system-memory-state
```
> [!IMPORTANT]
> This work also updates the `semantic_convention: ref:` to use a
relative URL, this was done as we want to ensure the same semconv
version from the metadata schema is used, otherwise the end user could
have a full url in `ref` with one semconv version and the schema version
being a different version. A new method has been introduced in mdatagen
that builds the semconv url at runtime.
Creates this table in the generated docs for that component:
#### Attributes
| Name | Description | Values | Requirement Level | Semantic Convention
|
| ---- | ----------- | ------ | ----------------- | -------------------
|
| state | Breakdown of memory usage by type. | Str: ``buffered``,
``cached``, ``inactive``, ``free``, ``slab_reclaimable``,
``slab_unreclaimable``, ``used`` | Recommended |
[state](https://github.com/open-telemetry/semantic-conventions/blob/v1.38.0/docs/registry/attributes/system.md#system-memory-state)
|
<!-- Issue number if applicable -->
#### Link to tracking issue
This work is linked to #13297 but doesn't close it.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
- loader_test.go was updated with attributes for `cpu` and `state`.
- Also `cmd/mdatagen/internal/samplereciever` was updated and generate
code created which creates tests.
<!--Describe the documentation added.-->
#### Documentation
The documentation template has been updated to reference the semconv
definition for attributes if provided in the schema.
4.7 KiB
receiverhelper
Internal Telemetry
The following telemetry is emitted by this component.
otelcol_receiver_accepted_log_records
Number of log records successfully pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {record} | Sum | Int | true | Alpha |
otelcol_receiver_accepted_metric_points
Number of metric points successfully pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {datapoint} | Sum | Int | true | Alpha |
otelcol_receiver_accepted_profile_samples
Number of profile samples successfully pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {sample} | Sum | Int | true | Alpha |
otelcol_receiver_accepted_spans
Number of spans successfully pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {span} | Sum | Int | true | Alpha |
otelcol_receiver_failed_log_records
The number of log records that failed to be processed by the receiver due to internal errors.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {record} | Sum | Int | true | Alpha |
otelcol_receiver_failed_metric_points
The number of metric points that failed to be processed by the receiver due to internal errors.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {datapoint} | Sum | Int | true | Alpha |
otelcol_receiver_failed_profile_samples
The number of profile samples that failed to be processed by the receiver due to internal errors.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {sample} | Sum | Int | true | Alpha |
otelcol_receiver_failed_spans
The number of spans that failed to be processed by the receiver due to internal errors.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {span} | Sum | Int | true | Alpha |
otelcol_receiver_refused_log_records
Number of log records that could not be pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {record} | Sum | Int | true | Alpha |
otelcol_receiver_refused_metric_points
Number of metric points that could not be pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {datapoint} | Sum | Int | true | Alpha |
otelcol_receiver_refused_profile_samples
Number of profile samples that could not be pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {sample} | Sum | Int | true | Alpha |
otelcol_receiver_refused_spans
Number of spans that could not be pushed into the pipeline.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {span} | Sum | Int | true | Alpha |
otelcol_receiver_requests
The number of requests performed.
| Unit | Metric Type | Value Type | Monotonic | Stability |
|---|---|---|---|---|
| {request} | Sum | Int | true | Alpha |
Attributes
| Name | Description | Values | Semantic Convention |
|---|---|---|---|
| outcome | The outcome of receiver requests | Str: success, refused, failure |
- |
Feature Gates
This component has the following feature gates:
| Feature Gate | Stage | Description | From Version | To Version | Reference |
|---|---|---|---|---|---|
receiverhelper.newReceiverMetrics |
alpha | Controls whether receivers emit new metrics and span attributes to distinguish downstream errors from internal errors. This is a breaking change for the semantics of the otelcol_receiver_refused_metric_points, otelcol_receiver_refused_log_records and otelcol_receiver_refused_spans. | v0.138.0 | N/A | Link |
For more information about feature gates, see the Feature Gates documentation.