Skip to content

Commit

Permalink
fix: add 'receiver.mongodb.removeDatabaseAttr' feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulali committed Nov 21, 2023
1 parent 60b8806 commit 8fb4c51
Show file tree
Hide file tree
Showing 15 changed files with 289 additions and 1,022 deletions.
2 changes: 1 addition & 1 deletion .chloggen/mongodbreceiver-duplicate-attribute-24972.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ change_type: 'bug_fix'
component: mongodbreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "add `receiver.mongodb.removeDatabaseResourceAttr` Alpha feature gate to remove duplicate database name attribute"
note: "add `receiver.mongodb.removeDatabaseAttr` Alpha feature gate to remove duplicate database name attribute"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [24972]
Expand Down
6 changes: 3 additions & 3 deletions receiver/mongodbreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ Details about the metrics produced by this receiver can be found in [metadata.ya
## Feature gate configurations
See the [Collector feature gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md#collector-feature-gates) for an overview of feature gates in the collector.

**ALPHA**: `receiver.mongodb.removeDatabaseResourceAttr`
**ALPHA**: `receiver.mongodb.removeDatabaseAttr`

The feature gate `receiver.mongodb.removeDatabaseResourceAttr` once enabled will remove database name resource attribute,
The feature gate `receiver.mongodb.removeDatabaseAttr` once enabled will remove database name attribute,
because both resource and datapoint attributes are called database.

This feature gate will eventually be enabled by default, and eventually the old implementation will be removed. It aims
to give users time to migrate to the new implementation. The target release for this featuregate to be enabled by default
is 0.93.0.
is 0.94.0.
52 changes: 1 addition & 51 deletions receiver/mongodbreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ The number of collections.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| {collections} | Sum | Int | Cumulative | false |
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
### mongodb.connection.count
The number of connections.
Expand All @@ -52,7 +46,6 @@ The number of connections.
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| type | The status of the connection. | Str: ``active``, ``available``, ``current`` |
### mongodb.cursor.count
Expand All @@ -79,12 +72,6 @@ The size of the collection. Data compression does not affect this value.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| By | Sum | Int | Cumulative | false |
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
### mongodb.database.count
The number of existing databases.
Expand All @@ -105,7 +92,6 @@ The number of document operations executed.
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| operation | The MongoDB operation being counted. | Str: ``insert``, ``query``, ``update``, ``delete``, ``getmore``, ``command`` |
### mongodb.extent.count
Expand All @@ -116,12 +102,6 @@ The number of extents.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| {extents} | Sum | Int | Cumulative | false |
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
### mongodb.global_lock.time
The time the global lock has been held.
Expand All @@ -142,7 +122,6 @@ The number of times an index has been accessed.
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| collection | The name of a collection. | Any Str |
### mongodb.index.count
Expand All @@ -153,12 +132,6 @@ The number of indexes.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| {indexes} | Sum | Int | Cumulative | false |
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
### mongodb.index.size
Sum of the space allocated to all indexes in the database, including free index space.
Expand All @@ -167,12 +140,6 @@ Sum of the space allocated to all indexes in the database, including free index
| ---- | ----------- | ---------- | ----------------------- | --------- |
| By | Sum | Int | Cumulative | false |
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
### mongodb.memory.usage
The amount of memory used.
Expand All @@ -185,7 +152,6 @@ The amount of memory used.
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| type | The type of memory used. | Str: ``resident``, ``virtual`` |
### mongodb.network.io.receive
Expand Down Expand Up @@ -220,12 +186,6 @@ The number of objects.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| {objects} | Sum | Int | Cumulative | false |
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
### mongodb.operation.count
The number of operations executed.
Expand Down Expand Up @@ -272,12 +232,6 @@ If collection data is compressed it reflects the compressed size.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| By | Sum | Int | Cumulative | true |
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
## Optional Metrics
The following metrics are not emitted by default. Each of them can be enabled by applying the following configuration:
Expand Down Expand Up @@ -310,7 +264,6 @@ Number of times the lock was acquired in the specified mode.
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| lock_type | The Resource over which the Lock controls access | Str: ``parallel_batch_write_mode``, ``replication_state_transition``, ``global``, ``database``, ``collection``, ``mutex``, ``metadata``, ``oplog`` |
| lock_mode | The mode of Lock which denotes the degree of access | Str: ``shared``, ``exclusive``, ``intent_shared``, ``intent_exclusive`` |
Expand All @@ -326,7 +279,6 @@ Cumulative wait time for the lock acquisitions.
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| lock_type | The Resource over which the Lock controls access | Str: ``parallel_batch_write_mode``, ``replication_state_transition``, ``global``, ``database``, ``collection``, ``mutex``, ``metadata``, ``oplog`` |
| lock_mode | The mode of Lock which denotes the degree of access | Str: ``shared``, ``exclusive``, ``intent_shared``, ``intent_exclusive`` |
Expand All @@ -342,7 +294,6 @@ Number of times the lock acquisitions encountered waits because the locks were h
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| lock_type | The Resource over which the Lock controls access | Str: ``parallel_batch_write_mode``, ``replication_state_transition``, ``global``, ``database``, ``collection``, ``mutex``, ``metadata``, ``oplog`` |
| lock_mode | The mode of Lock which denotes the degree of access | Str: ``shared``, ``exclusive``, ``intent_shared``, ``intent_exclusive`` |
Expand All @@ -358,7 +309,6 @@ Number of times the lock acquisitions encountered deadlocks.
| Name | Description | Values |
| ---- | ----------- | ------ |
| database | The name of a database. | Any Str |
| lock_type | The Resource over which the Lock controls access | Str: ``parallel_batch_write_mode``, ``replication_state_transition``, ``global``, ``database``, ``collection``, ``mutex``, ``metadata``, ``oplog`` |
| lock_mode | The mode of Lock which denotes the degree of access | Str: ``shared``, ``exclusive``, ``intent_shared``, ``intent_exclusive`` |
Expand Down Expand Up @@ -402,4 +352,4 @@ The amount of time that the server has been running.
| Name | Description | Values | Enabled |
| ---- | ----------- | ------ | ------- |
| database | The name of a database. | Any Str | false |
| database | The name of a database. | Any Str | true |

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

Loading

0 comments on commit 8fb4c51

Please sign in to comment.