Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/zookeeper] removing direction feature gate #14962

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chloggen/rm-direction-zookeeper.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: zookeeperreceiver

# 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: [14962]

# (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/zookeeperreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,5 @@ receivers:

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

### 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.zookeeperreceiver.emitMetricsWithoutDirectionAttribute**
- **receiver.zookeeperreceiver.emitMetricsWithDirectionAttribute**

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

[in development]: https://github.com/open-telemetry/opentelemetry-collector#in-development
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
2 changes: 0 additions & 2 deletions receiver/zookeeperreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ These are the metrics available for this scraper.
| **zookeeper.latency.max** | Maximum time in milliseconds for requests to be processed. | ms | Gauge(Int) | <ul> </ul> |
| **zookeeper.latency.min** | Minimum time in milliseconds for requests to be processed. | ms | Gauge(Int) | <ul> </ul> |
| **zookeeper.packet.count** | The number of ZooKeeper packets received or sent by a server. | {packets} | Sum(Int) | <ul> <li>direction</li> </ul> |
| **zookeeper.packet.received.count** | The number of ZooKeeper packets received by a server. | {packets} | Sum(Int) | <ul> </ul> |
| **zookeeper.packet.sent.count** | The number of ZooKeeper packets sent by a server. | {packets} | Sum(Int) | <ul> </ul> |
| **zookeeper.request.active** | Number of currently executing requests. | {requests} | Sum(Int) | <ul> </ul> |
| **zookeeper.sync.pending** | The number of pending syncs from the followers. Only exposed by the leader. | {syncs} | Sum(Int) | <ul> </ul> |
| **zookeeper.watch.count** | Number of watches placed on Z-Nodes on a ZooKeeper server. | {watches} | Sum(Int) | <ul> </ul> |
Expand Down
126 changes: 0 additions & 126 deletions receiver/zookeeperreceiver/internal/metadata/generated_metrics.go

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

19 changes: 0 additions & 19 deletions receiver/zookeeperreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ metrics:
unit: "{file_descriptors}"
gauge:
value_type: int
# produced when receiver.zookeeperreceiver.emitMetricsWithDirectionAttribute feature gate is enabled
zookeeper.packet.count:
enabled: true
description: The number of ZooKeeper packets received or sent by a server.
Expand All @@ -128,24 +127,6 @@ metrics:
value_type: int
monotonic: true
aggregation: cumulative
# produced when receiver.zookeeperreceiver.emitMetricsWithoutDirectionAttribute feature gate is enabled
zookeeper.packet.sent.count:
enabled: true
description: The number of ZooKeeper packets sent by a server.
unit: "{packets}"
sum:
value_type: int
monotonic: true
aggregation: cumulative
# produced when receiver.zookeeperreceiver.emitMetricsWithoutDirectionAttribute feature gate is enabled
zookeeper.packet.received.count:
enabled: true
description: The number of ZooKeeper packets received by a server.
unit: "{packets}"
sum:
value_type: int
monotonic: true
aggregation: cumulative
zookeeper.fsync.exceeded_threshold.count:
enabled: true
description: Number of times fsync duration has exceeded warning threshold.
Expand Down
24 changes: 5 additions & 19 deletions receiver/zookeeperreceiver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,12 @@ type metricCreator struct {
computedMetricStore map[string]int64
mb *metadata.MetricsBuilder
// Temporary feature gates while transitioning to metrics without a direction attribute
emitMetricsWithDirectionAttribute bool
emitMetricsWithoutDirectionAttribute bool
}

func newMetricCreator(mb *metadata.MetricsBuilder, emitMetricsWithDirectionAttribute, emitMetricsWithoutDirectionAttribute bool) *metricCreator {
func newMetricCreator(mb *metadata.MetricsBuilder) *metricCreator {
return &metricCreator{
computedMetricStore: make(map[string]int64),
mb: mb,
emitMetricsWithDirectionAttribute: emitMetricsWithDirectionAttribute,
emitMetricsWithoutDirectionAttribute: emitMetricsWithoutDirectionAttribute,
computedMetricStore: make(map[string]int64),
mb: mb,
}
}

Expand Down Expand Up @@ -106,21 +102,11 @@ func (m *metricCreator) recordDataPointsFunc(metric string) func(ts pcommon.Time
return m.mb.RecordZookeeperFsyncExceededThresholdCountDataPoint
case packetsReceivedMetricKey:
return func(ts pcommon.Timestamp, val int64) {
if m.emitMetricsWithDirectionAttribute {
m.mb.RecordZookeeperPacketCountDataPoint(ts, val, metadata.AttributeDirectionReceived)
}
if m.emitMetricsWithoutDirectionAttribute {
m.mb.RecordZookeeperPacketReceivedCountDataPoint(ts, val)
}
m.mb.RecordZookeeperPacketCountDataPoint(ts, val, metadata.AttributeDirectionReceived)
}
case packetsSentMetricKey:
return func(ts pcommon.Timestamp, val int64) {
if m.emitMetricsWithDirectionAttribute {
m.mb.RecordZookeeperPacketCountDataPoint(ts, val, metadata.AttributeDirectionSent)
}
if m.emitMetricsWithoutDirectionAttribute {
m.mb.RecordZookeeperPacketSentCountDataPoint(ts, val)
}
m.mb.RecordZookeeperPacketCountDataPoint(ts, val, metadata.AttributeDirectionSent)
}
}

Expand Down
Loading