-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[com.influxdata.telegraf] Add OpenTelemetry Output plugin (#66)
- Loading branch information
Showing
5 changed files
with
154 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -22,5 +22,5 @@ dependencies { | |
} | ||
|
||
package { | ||
version = "1.1.1" | ||
version = "1.2.0" | ||
} |
This file contains 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
42 changes: 42 additions & 0 deletions
42
packages/com.influxdata.telegraf/examples/opentelemetry-output.pkl
This file contains 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,42 @@ | ||
//===----------------------------------------------------------------------===// | ||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//===----------------------------------------------------------------------===// | ||
amends "../Telegraf.pkl" | ||
|
||
outputs { | ||
opentelemetry { | ||
new { | ||
service_address = "localhost:4312" | ||
timeout = 10.s | ||
tls_ca = "/path/to/ca/cert" | ||
tls_cert = "/path/to/cert" | ||
tls_key = "/path/to/key" | ||
tls_server_name = "tls-server.com" | ||
compression = "gzip" | ||
coralogix { | ||
application = "myapp" | ||
private_key = "my secret value" | ||
subsystem = "my subsystem" | ||
} | ||
attributes { | ||
["service.name"] = "foo" | ||
["service.version"] = "1.0.0" | ||
} | ||
headers { | ||
["x-api-key"] = "my-api-key" | ||
} | ||
} | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
packages/com.influxdata.telegraf/plugins/outputs/OpenTelemetryOutput.pkl
This file contains 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,80 @@ | ||
//===----------------------------------------------------------------------===// | ||
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
//===----------------------------------------------------------------------===// | ||
/// Sends metrics to [OpenTelemetry](https://opentelemetry.io) servers and agents via gRPC. | ||
/// | ||
/// <https://github.com/influxdata/telegraf/tree/master/plugins/outputs/opentelemetry> | ||
@ModuleInfo { minPklVersion = "0.24.0" } | ||
open module com.influxdata.telegraf.plugins.outputs.OpenTelemetryOutput | ||
|
||
extends "Output.pkl" | ||
|
||
/// The endpoint to which the metrics will be sent. | ||
/// | ||
/// Default: `"localhost:4317"` | ||
service_address: String? | ||
|
||
/// The timeout for the connection. | ||
/// | ||
/// Default: `5.s` | ||
timeout: Duration? | ||
|
||
/// Optional TLS Config. | ||
/// All variables should specify full path to the file. | ||
/// Root certificates for verifying server certificates encoded in PEM format. | ||
tls_ca: String? | ||
|
||
/// Path to the TLS certificate for the client encoded in PEM format. | ||
/// May contain intermediate certificates. | ||
tls_cert: String? | ||
|
||
/// Path to the TLS private key for the client encoded in PEM format. | ||
tls_key: String? | ||
|
||
/// Send the specified TLS server name via SNI. | ||
tls_server_name: String? | ||
|
||
/// Insecure option to skip TLS server cert verification. | ||
/// | ||
/// Warning: it is insecure to enable this option. | ||
/// If enabled, crypto/tls accepts any certificate presented by the server and any host name in that certificate. | ||
/// | ||
/// Default: `false` | ||
insecure_skip_verify: Boolean? | ||
|
||
/// Send data to a [Coralogix](https://coralogix.com) server. | ||
coralogix: Coralogix? | ||
|
||
/// Set the compression method used to send data. | ||
/// | ||
/// Default: `"none"` | ||
compression: ("none"|"gzip")? | ||
|
||
/// Additional OpenTelemetry resource attributes | ||
attributes: Mapping<String,String>? | ||
|
||
/// Additional gRPC request metadata headers | ||
headers: Mapping<String,String>? | ||
|
||
class Coralogix { | ||
/// The private key, which can be found in Settings > Send Your Data. | ||
private_key: String | ||
|
||
/// The application name, which will be added to metric attributes. | ||
application: String | ||
|
||
/// The subsystem name, which will be added to metric attributes. | ||
subsystem: String | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/com.influxdata.telegraf/tests/Telegraf.pkl-expected.pcf
This file contains 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