Skip to content

Commit

Permalink
Merge pull request #51 from castai/stdout_example
Browse files Browse the repository at this point in the history
docs: example for writing JSON logs to stdout
  • Loading branch information
oskarwojciski authored Jul 11, 2024
2 parents b125168 + 1cecc2c commit cc6b57a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Additional tools / instrumentation / examples are provided for smooth experience
- Building and compiling Open Telemetry Collector using Make files
- Building and hosting Docker image
- Helm chart for running collector on k8s
- Several Open Telemetry examples with different destinations (file, Grafana Loki, Coralogix)
- Several Open Telemetry examples with different destinations (file, Grafana Loki, Coralogix, raw JSON in stdout)


### Setting things up
Expand Down
27 changes: 27 additions & 0 deletions examples/stdout/collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
receivers:
castai_audit_logs:
api:
url: ${env:CASTAI_API_URL} # Use CASTAI_API_URL env variable to override default API URL (https://api.cast.ai/)
key: ${env:CASTAI_API_KEY} # Use CASTAI_API_KEY env variable to provide API Access Key
poll_interval_sec: 10 # This parameter defines poll cycle in seconds.
page_limit: 100 # This parameter defines the max number of records returned from the backend in one page.
storage:
type: "persistent"
filename: "./audit_logs_poll_data.json"

exporters:
file:
path: /dev/stdout # Write logs directly to stdout in JSON format
flush_interval: 100ms

processors:

service:
telemetry:
logs:
level: "error"
pipelines:
logs:
receivers: [castai_audit_logs]
processors: []
exporters: [file]

0 comments on commit cc6b57a

Please sign in to comment.