-
Notifications
You must be signed in to change notification settings - Fork 638
feat(nats): add JetStream data stream #20980
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
Open
nikolaigut
wants to merge
15
commits into
elastic:main
Choose a base branch
from
nikolaigut:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0c8a48c
Add JetStream data stream to NATS integration
cd3214e
fix(nats): align JetStream field definitions, docs, and stack version
ff4bf95
docs(nats): update JetStream monitoring documentation URL
b4e589b
Merge pull request #1 from nikolaigut/nats-jetstream-10748
nikolaigut d2534c9
fix(nats): use POSIX test in run.sh and reduce TSDB dimensions
4dd186c
Merge branch 'nats-jetstream-10748'
aa86374
fix(nats): add entity scoping dimensions, bump TSDB limit, and fail f…
e08d7c9
Merge branch 'nats-jetstream-10748'
2de06f1
fix(nats): add duration formats, enforce agent condition, and update …
48ea999
Merge branch 'nats-jetstream-10748'
bec8a2b
fix(nats): align Kibana version floor, fix ack_floor descriptions, an…
1a28a92
Merge branch 'nats-jetstream-10748'
3291d1b
docs(nats): clarify package compatibility and update changelog link t…
8ea1d89
Merge branch 'nats-jetstream-10748'
0f33e36
Merge branch 'main' into main
nikolaigut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,19 @@ | ||
| ARG NATS_VERSION=2.0.4 | ||
| ARG NATS_VERSION=2.10.27 | ||
| FROM nats:$NATS_VERSION | ||
|
|
||
| # build stage | ||
| FROM golang:1.20.2-alpine3.17 AS build-env | ||
| RUN apk --no-cache add build-base git mercurial gcc | ||
| RUN go install github.com/nats-io/nats.go/examples/nats-bench@v1.10.0 | ||
| FROM golang:1.25-alpine AS build-env | ||
| RUN apk --no-cache add build-base git gcc | ||
| RUN go install github.com/nats-io/nats.go/examples/nats-bench@v1.36.0 | ||
|
|
||
| # create an enhanced container with nc command available since nats is based | ||
| # on scratch image making healthcheck impossible | ||
| FROM alpine:3.17 | ||
| FROM alpine:3.20 | ||
| COPY --from=0 / /opt/nats | ||
| COPY --from=build-env /go/bin/nats-bench /nats-bench | ||
| COPY run.sh /run.sh | ||
| # Expose client, management, and cluster ports | ||
| EXPOSE 4222 8222 6222 | ||
| HEALTHCHECK --interval=1s --retries=10 CMD nc -w 1 0.0.0.0 8222 </dev/null | ||
| HEALTHCHECK --interval=1s --retries=30 CMD nc -w 1 0.0.0.0 8222 </dev/null | ||
| # Run via the configuration file | ||
| CMD ["/run.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| variants: | ||
| v1: | ||
| SERVICE_VERSION: 1.3.0 | ||
| v2: | ||
| SERVICE_VERSION: 2.1.4 | ||
| default: v2 | ||
| SERVICE_VERSION: 2.10.27 | ||
| default: v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/nats/data_stream/jetstream/_dev/test/system/test-default-config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| vars: | ||
| hosts: | ||
| - http://{{Hostname}}:{{Port}} | ||
| data_stream: | ||
| vars: ~ |
33 changes: 33 additions & 0 deletions
33
packages/nats/data_stream/jetstream/agent/stream/stream.yml.hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| metricsets: ["jetstream"] | ||
| hosts: | ||
| {{#each hosts}} | ||
| - {{this}} | ||
| {{/each}} | ||
| period: {{period}} | ||
| jetstream: | ||
| stats: | ||
| enabled: {{jetstream_stats_enabled}} | ||
| account: | ||
| enabled: {{jetstream_account_enabled}} | ||
| {{#if jetstream_account_names}} | ||
| names: | ||
| {{#each jetstream_account_names}} | ||
| - {{this}} | ||
| {{/each}} | ||
| {{/if}} | ||
| stream: | ||
| enabled: {{jetstream_stream_enabled}} | ||
| {{#if jetstream_stream_names}} | ||
| names: | ||
| {{#each jetstream_stream_names}} | ||
| - {{this}} | ||
| {{/each}} | ||
| {{/if}} | ||
| consumer: | ||
| enabled: {{jetstream_consumer_enabled}} | ||
| {{#if jetstream_consumer_names}} | ||
| names: | ||
| {{#each jetstream_consumer_names}} | ||
| - {{this}} | ||
| {{/each}} | ||
| {{/if}} |
20 changes: 20 additions & 0 deletions
20
packages/nats/data_stream/jetstream/fields/base-fields.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| - name: data_stream.type | ||
| type: constant_keyword | ||
| description: Data stream type. | ||
| - name: data_stream.dataset | ||
| type: constant_keyword | ||
| description: Data stream dataset. | ||
| - name: data_stream.namespace | ||
| type: constant_keyword | ||
| description: Data stream namespace. | ||
| - name: '@timestamp' | ||
| type: date | ||
| description: Event timestamp. | ||
| - name: event.module | ||
| type: constant_keyword | ||
| description: Event module | ||
| value: nats | ||
| - name: event.dataset | ||
| type: constant_keyword | ||
| description: Event dataset | ||
| value: nats.jetstream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| - external: ecs | ||
| name: service.address | ||
| dimension: true | ||
| - external: ecs | ||
| name: agent.id | ||
| dimension: true | ||
| - external: ecs | ||
| name: cloud.account.id | ||
| dimension: true | ||
| - external: ecs | ||
| name: cloud.region | ||
| dimension: true | ||
| - external: ecs | ||
| name: cloud.availability_zone | ||
| dimension: true | ||
| - external: ecs | ||
| name: cloud.instance.id | ||
| dimension: true | ||
| - external: ecs | ||
| name: cloud.provider | ||
| dimension: true | ||
| - external: ecs | ||
| name: container.id | ||
| dimension: true | ||
| - external: ecs | ||
| name: host.name | ||
| dimension: true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.