Skip to content

Commit

Permalink
[receiver/elasticsearch] removing direction feature gate (#14955)
Browse files Browse the repository at this point in the history
The following feature gates have been removed after being deprecated for a few versions:

- receiver.elasticsearchreceiver.emitMetricsWithoutDirectionAttribute
- receiver.elasticsearchreceiver.emitMetricsWithDirectionAttribute
  • Loading branch information
Alex Boten authored Oct 15, 2022
1 parent 38e12d9 commit fb423ba
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 2,887 deletions.
16 changes: 16 additions & 0 deletions .chloggen/rm-direction-elasticsearch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "removing direction feature gate"

# One or more tracking issues related to the change
issues: [14955]

# (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:
12 changes: 0 additions & 12 deletions receiver/elasticsearchreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,5 @@ The following metric are available with versions:

Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml)

### Feature gate configurations

#### Transition from metrics with "direction" attribute

The proposal to change metrics from being reported with a `direction` attribute has been reverted in the specification. As a result, the
following feature gates will be removed in v0.62.0:

- **receiver.elasticsearchreceiver.emitMetricsWithoutDirectionAttribute**
- **receiver.elasticsearchreceiver.emitMetricsWithDirectionAttribute**

For additional information, see https://github.com/open-telemetry/opentelemetry-specification/issues/2726.

[beta]:https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
2 changes: 0 additions & 2 deletions receiver/elasticsearchreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ These are the metrics available for this scraper.
| **elasticsearch.node.cache.memory.usage** | The size in bytes of the cache. | By | Sum(Int) | <ul> <li>cache_name</li> </ul> |
| **elasticsearch.node.cluster.connections** | The number of open tcp connections for internal cluster communication. | {connections} | Sum(Int) | <ul> </ul> |
| **elasticsearch.node.cluster.io** | The number of bytes sent and received on the network for internal cluster communication. | By | Sum(Int) | <ul> <li>direction</li> </ul> |
| **elasticsearch.node.cluster.io.received** | The number of bytes received on the network for internal cluster communication. | By | Sum(Int) | <ul> </ul> |
| **elasticsearch.node.cluster.io.sent** | The number of bytes sent on the network for internal cluster communication. | By | Sum(Int) | <ul> </ul> |
| **elasticsearch.node.disk.io.read** | The total number of kilobytes read across all file stores for this node. | KiBy | Sum(Int) | <ul> </ul> |
| **elasticsearch.node.disk.io.write** | The total number of kilobytes written across all file stores for this node. | KiBy | Sum(Int) | <ul> </ul> |
| **elasticsearch.node.documents** | The number of documents on the node. | {documents} | Sum(Int) | <ul> <li>document_state</li> </ul> |
Expand Down
15 changes: 0 additions & 15 deletions receiver/elasticsearchreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import (
"go.opentelemetry.io/collector/config"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/featuregate"
"go.opentelemetry.io/collector/receiver/scraperhelper"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/elasticsearchreceiver/internal/metadata"
)
Expand Down Expand Up @@ -64,12 +62,6 @@ func createDefaultConfig() config.Receiver {

var errConfigNotES = errors.New("config was not an elasticsearch receiver config")

func logDeprecatedFeatureGateForDirection(log *zap.Logger, gate featuregate.Gate) {
log.Warn("WARNING: The " + gate.ID + " feature gate is deprecated and will be removed in the next release. The change to remove " +
"the direction attribute has been reverted in the specification. See https://github.com/open-telemetry/opentelemetry-specification/issues/2726 " +
"for additional details.")
}

// createMetricsReceiver creates a metrics receiver for scraping elasticsearch metrics.
func createMetricsReceiver(
_ context.Context,
Expand All @@ -83,13 +75,6 @@ func createMetricsReceiver(
}
es := newElasticSearchScraper(params, c)

if !es.emitMetricsWithDirectionAttribute {
logDeprecatedFeatureGateForDirection(es.settings.Logger, emitMetricsWithDirectionAttributeFeatureGate)
}

if es.emitMetricsWithoutDirectionAttribute {
logDeprecatedFeatureGateForDirection(es.settings.Logger, emitMetricsWithoutDirectionAttributeFeatureGate)
}
scraper, err := scraperhelper.NewScraper(typeStr, es.scrape, scraperhelper.WithStart(es.start))
if err != nil {
return nil, err
Expand Down
126 changes: 0 additions & 126 deletions receiver/elasticsearchreceiver/internal/metadata/generated_metrics.go

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

21 changes: 0 additions & 21 deletions receiver/elasticsearchreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ metrics:
value_type: int
attributes: [ ]
enabled: true
# produced when receiver.elasticsearchreceiver.emitMetricsWithDirectionAttribute feature gate is enabled
elasticsearch.node.cluster.io:
description: The number of bytes sent and received on the network for internal cluster communication.
unit: By
Expand All @@ -266,26 +265,6 @@ metrics:
value_type: int
attributes: [direction]
enabled: true
# produced when receiver.elasticsearchreceiver.emitMetricsWithoutDirectionAttribute feature gate is enabled
elasticsearch.node.cluster.io.received:
description: The number of bytes received on the network for internal cluster communication.
unit: By
sum:
monotonic: true
aggregation: cumulative
value_type: int
attributes: []
enabled: true
# produced when receiver.elasticsearchreceiver.emitMetricsWithoutDirectionAttribute feature gate is enabled
elasticsearch.node.cluster.io.sent:
description: The number of bytes sent on the network for internal cluster communication.
unit: By
sum:
monotonic: true
aggregation: cumulative
value_type: int
attributes: []
enabled: true
elasticsearch.node.cluster.connections:
description: The number of open tcp connections for internal cluster communication.
unit: "{connections}"
Expand Down
Loading

0 comments on commit fb423ba

Please sign in to comment.