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

[NATS] Add connection data stream metric types #7740

Merged
merged 11 commits into from
Oct 12, 2023
5 changes: 5 additions & 0 deletions packages/nats/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.3.6"
changes:
- description: Add connection data stream metric types.
type: enhancement
link: https://github.com/elastic/integrations/pull/7740
- version: "1.3.5"
changes:
- description: Add dimensions mapping to connection data stream.
Expand Down
8 changes: 8 additions & 0 deletions packages/nats/data_stream/connection/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,52 @@
The name of the connection
- name: subscriptions
type: integer
metric_type: gauge
description: |
The number of subscriptions in this connection
- name: pending_bytes
type: long
format: bytes
metric_type: gauge
description: |
The number of pending bytes of this connection
- name: uptime
type: long
format: duration
metric_type: counter
description: |
The period the connection is up (sec)
- name: idle_time
type: long
format: duration
metric_type: counter
description: |
The period the connection is idle (sec)
- name: in
type: group
fields:
- name: messages
type: long
metric_type: counter
description: |
The amount of incoming messages
- name: bytes
type: long
format: bytes
metric_type: counter
description: |
The amount of incoming bytes
- name: out
type: group
fields:
- name: messages
type: long
metric_type: counter
description: |
The amount of outgoing messages
- name: bytes
type: long
metric_type: counter
format: bytes
description: |
The amount of outgoing bytes
60 changes: 30 additions & 30 deletions packages/nats/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,36 +687,36 @@ An example event for `connection` looks as following:

**Exported fields**

| Field | Description | Type |
|---|---|---|
| @timestamp | Event timestamp. | date |
| agent.id | Unique identifier of this agent (if one exists). Example: For Beats this would be beat.id. | keyword |
| cloud.account.id | The cloud account or organization id used to identify different entities in a multi-tenant environment. Examples: AWS account id, Google Cloud ORG Id, or other unique identifier. | keyword |
| cloud.availability_zone | Availability zone in which this host, resource, or service is located. | keyword |
| cloud.instance.id | Instance ID of the host machine. | keyword |
| cloud.provider | Name of the cloud provider. Example values are aws, azure, gcp, or digitalocean. | keyword |
| cloud.region | Region in which this host, resource, or service is located. | keyword |
| container.id | Unique container id. | keyword |
| data_stream.dataset | Data stream dataset. | constant_keyword |
| data_stream.namespace | Data stream namespace. | constant_keyword |
| data_stream.type | Data stream type. | constant_keyword |
| ecs.version | ECS version this event conforms to. `ecs.version` is a required field and must exist in all events. When querying across multiple indices -- which may conform to slightly different ECS versions -- this field lets integrations adjust to the schema version of the events. | keyword |
| event.dataset | Event dataset | constant_keyword |
| event.module | Event module | constant_keyword |
| host.name | Name of the host. It can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use. | keyword |
| nats.connection.idle_time | The period the connection is idle (sec) | long |
| nats.connection.in.bytes | The amount of incoming bytes | long |
| nats.connection.in.messages | The amount of incoming messages | long |
| nats.connection.name | The name of the connection | keyword |
| nats.connection.out.bytes | The amount of outgoing bytes | long |
| nats.connection.out.messages | The amount of outgoing messages | long |
| nats.connection.pending_bytes | The number of pending bytes of this connection | long |
| nats.connection.subscriptions | The number of subscriptions in this connection | integer |
| nats.connection.uptime | The period the connection is up (sec) | long |
| nats.server.id | The server ID | keyword |
| nats.server.time | Server time of metric creation | date |
| service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword |
| service.type | The type of the service data is collected from. The type can be used to group and correlate logs and metrics from one service type. Example: If logs or metrics are collected from Elasticsearch, `service.type` would be `elasticsearch`. | keyword |
| Field | Description | Type | Metric Type |
|---|---|---|---|
| @timestamp | Event timestamp. | date | |
| agent.id | Unique identifier of this agent (if one exists). Example: For Beats this would be beat.id. | keyword | |
| cloud.account.id | The cloud account or organization id used to identify different entities in a multi-tenant environment. Examples: AWS account id, Google Cloud ORG Id, or other unique identifier. | keyword | |
| cloud.availability_zone | Availability zone in which this host, resource, or service is located. | keyword | |
| cloud.instance.id | Instance ID of the host machine. | keyword | |
| cloud.provider | Name of the cloud provider. Example values are aws, azure, gcp, or digitalocean. | keyword | |
| cloud.region | Region in which this host, resource, or service is located. | keyword | |
| container.id | Unique container id. | keyword | |
| data_stream.dataset | Data stream dataset. | constant_keyword | |
| data_stream.namespace | Data stream namespace. | constant_keyword | |
| data_stream.type | Data stream type. | constant_keyword | |
| ecs.version | ECS version this event conforms to. `ecs.version` is a required field and must exist in all events. When querying across multiple indices -- which may conform to slightly different ECS versions -- this field lets integrations adjust to the schema version of the events. | keyword | |
| event.dataset | Event dataset | constant_keyword | |
| event.module | Event module | constant_keyword | |
| host.name | Name of the host. It can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use. | keyword | |
| nats.connection.idle_time | The period the connection is idle (sec) | long | counter |
| nats.connection.in.bytes | The amount of incoming bytes | long | counter |
| nats.connection.in.messages | The amount of incoming messages | long | counter |
| nats.connection.name | The name of the connection | keyword | |
| nats.connection.out.bytes | The amount of outgoing bytes | long | counter |
| nats.connection.out.messages | The amount of outgoing messages | long | counter |
| nats.connection.pending_bytes | The number of pending bytes of this connection | long | gauge |
| nats.connection.subscriptions | The number of subscriptions in this connection | integer | gauge |
| nats.connection.uptime | The period the connection is up (sec) | long | counter |
| nats.server.id | The server ID | keyword | |
| nats.server.time | Server time of metric creation | date | |
| service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | |
| service.type | The type of the service data is collected from. The type can be used to group and correlate logs and metrics from one service type. Example: If logs or metrics are collected from Elasticsearch, `service.type` would be `elasticsearch`. | keyword | |


### route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@
"dataType": "number",
"isBucketed": false,
"label": "Connection Incoming Bytes",
"operationType": "average",
"operationType": "max",
"params": {
"emptyAsNull": true,
"format": {
Expand Down Expand Up @@ -1718,7 +1718,7 @@
"dataType": "number",
"isBucketed": false,
"label": "Connection Uptime",
"operationType": "average",
"operationType": "max",
"params": {
"emptyAsNull": true,
"format": {
Expand Down
2 changes: 1 addition & 1 deletion packages/nats/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nats
title: NATS
version: 1.3.5
version: 1.3.6
release: ga
description: Collect logs and metrics from NATS servers with Elastic Agent.
type: integration
Expand Down