-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(new sink): Initial datadog_events sink
#7678
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4f75a71
Initial
ktff 7370163
Fixes
ktff e1d3e88
Fixes
ktff 907c2e7
Tests
ktff 2c3de72
Add docs
ktff e55a751
Add semantic
ktff 99a74ca
Move url
ktff f4163a2
Fix url
ktff 3497017
Add request docs
ktff 26be43e
Add batch docs
ktff 928fb6b
Bump
ktff c380977
Clippy
ktff 54094d9
Apply feedback
ktff 5dfddcd
Apply feedback
ktff b8ef075
Add use
ktff ad31123
Bump
ktff 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 |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| package metadata | ||
|
|
||
| components: sinks: datadog_events: { | ||
| title: "Datadog Events" | ||
|
|
||
| classes: sinks._datadog.classes | ||
|
|
||
| features: { | ||
| buffer: enabled: true | ||
| healthcheck: enabled: true | ||
| send: { | ||
| batch: { | ||
| enabled: false | ||
| common: false | ||
| timeout_secs: 0 | ||
| } | ||
| compression: enabled: false | ||
| encoding: enabled: false | ||
| request: { | ||
| enabled: true | ||
| adaptive_concurrency: true | ||
| concurrency: 5 | ||
| rate_limit_duration_secs: 1 | ||
| rate_limit_num: 5 | ||
| retry_initial_backoff_secs: 1 | ||
| retry_max_duration_secs: 10 | ||
| timeout_secs: 30 | ||
| headers: false | ||
| } | ||
| tls: { | ||
| enabled: true | ||
| can_enable: true | ||
| can_verify_certificate: true | ||
| can_verify_hostname: true | ||
| enabled_default: true | ||
| } | ||
| to: { | ||
| service: services.datadog_events | ||
|
|
||
| interface: { | ||
| socket: { | ||
| api: { | ||
| title: "Datadog events API" | ||
| url: urls.datadog_events_endpoints | ||
| } | ||
| direction: "outgoing" | ||
| protocols: ["http"] | ||
| ssl: "required" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| support: sinks._datadog.support | ||
|
|
||
| configuration: { | ||
| default_api_key: { | ||
| description: "Default Datadog [API key](https://docs.datadoghq.com/api/?lang=bash#authentication), if an event has a key set in its metadata it will prevail over the one set here." | ||
| required: true | ||
| warnings: [] | ||
| type: string: { | ||
| examples: ["${DATADOG_API_KEY_ENV_VAR}", "ef8d5de700e7989468166c40fc8a0ccd"] | ||
| syntax: "literal" | ||
| } | ||
| } | ||
| endpoint: sinks._datadog.configuration.endpoint | ||
| site: sinks._datadog.configuration.site | ||
| } | ||
|
|
||
| input: { | ||
| logs: true | ||
| metrics: null | ||
| } | ||
| } |
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,10 @@ | ||
| package metadata | ||
|
|
||
| services: datadog_events: { | ||
| name: "Datadog events" | ||
| thing: "a \(name) index" | ||
| url: urls.datadog_events | ||
| versions: null | ||
|
|
||
| description: services._datadog.description | ||
| } |
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
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,35 @@ | ||
| use super::InternalEvent; | ||
| use metrics::counter; | ||
|
|
||
| #[derive(Debug)] | ||
| pub struct DatadogEventsProcessed { | ||
| pub byte_size: usize, | ||
| } | ||
|
|
||
| impl InternalEvent for DatadogEventsProcessed { | ||
| fn emit_metrics(&self) { | ||
| counter!("processed_bytes_total", self.byte_size as u64); | ||
| } | ||
| } | ||
|
|
||
| #[derive(Debug)] | ||
| pub struct DatadogEventsFieldInvalid { | ||
| pub field: &'static str, | ||
| } | ||
|
|
||
| impl InternalEvent for DatadogEventsFieldInvalid { | ||
| fn emit_logs(&self) { | ||
| debug!( | ||
| message = "Required field is missing.", | ||
| field = %self.field, | ||
| internal_log_rate_secs = 10 | ||
| ); | ||
|
ktff marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| fn emit_metrics(&self) { | ||
| counter!( | ||
| "processing_errors_total", 1, | ||
| "error_type" => "field_missing", | ||
| "field" => self.field); | ||
| } | ||
| } | ||
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
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.