Skip to content

Commit

Permalink
Add yamllint during PRs (#4)
Browse files Browse the repository at this point in the history
* run yamllint on PRs
  • Loading branch information
smithclay committed Feb 27, 2024
1 parent bbcf61a commit c9d7b17
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 65 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
name: Build
on:
pull_request:

paths:
- collector/**
jobs:
build_linux:
runs-on: ubuntu-20.04
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pr_checks
on:
pull_request:

jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: collector/config/*.yaml collector/config-k8s/*.yaml
config_file: .yamllint.yml
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Tests
on:
pull_request:
paths:
- collector/**

jobs:
unit-tests:
Expand Down
6 changes: 6 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: default

rules:
line-length:
max: 80
level: warning
3 changes: 3 additions & 0 deletions collector/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ALLDOC := $(shell find .. \( -name "*.md" -o -name "*.yaml" \) \
-type f | sort)

.PHONY: all - Default target
all: build

Expand Down
20 changes: 10 additions & 10 deletions collector/config-k8s/values-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ config:
collection_interval: 30s
jaeger: null
zipkin: null

processors:
resourcedetection/gcp:
detectors: [env, gcp]
Expand Down Expand Up @@ -92,9 +92,9 @@ config:
headers:
"lightstep-access-token": "${env:CLOUDOBS_TOKEN}"
sending_queue:
enabled: true
num_consumers: 4
queue_size: 100
enabled: true
num_consumers: 4
queue_size: 100

service:
# This isn't the final pipeline configuration: the helm chart values
Expand All @@ -104,14 +104,14 @@ config:
traces: null
# Send metrics about the collector itself to Cloud Observability
metrics/collector-monitoring:
receivers: [ prometheus ]
processors: [ batch ]
exporters: [ otlp/cloudobs ]
receivers: [prometheus]
processors: [batch]
exporters: [otlp/cloudobs]
metrics:
exporters: [ otlp/cloudobs ]
exporters: [otlp/cloudobs]
logs:
processors: [ transform/events, batch ]
exporters: [ otlp/cloudobs ]
processors: [transform/events, batch]
exporters: [otlp/cloudobs]

ports:
jaeger-compact:
Expand Down
6 changes: 3 additions & 3 deletions collector/config-k8s/values-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ config:
headers:
"lightstep-access-token": "${env:CLOUDOBS_TOKEN}"
sending_queue:
enabled: true
num_consumers: 4
queue_size: 100
enabled: true
num_consumers: 4
queue_size: 100

service:
# This isn't the final pipeline configuration: the helm chart values
Expand Down
22 changes: 11 additions & 11 deletions collector/config/otelcol-docker-hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ receivers:
- job_name: otel-collector
scrape_interval: 5s
static_configs:
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
hostmetrics:
# needed to read host metrics from Docker cntainer
# host path ostmust be mounted to the container
Expand Down Expand Up @@ -78,11 +78,11 @@ exporters:
otlp/lightstep:
endpoint: ingest.lightstep.com:443
headers:
'lightstep-access-token': '${LS_TOKEN}'
"lightstep-access-token": "${LS_TOKEN}"
sending_queue:
enabled: true
num_consumers: 4
queue_size: 100
enabled: true
num_consumers: 4
queue_size: 100
# Send to HLA
servicenow/logs:
instance_logs_url: ${MID_INSTANCE_LOGS_URL}
Expand Down Expand Up @@ -119,6 +119,6 @@ service:
processors: [batch, resourcedetection]
exporters: [debug]
metrics/host:
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
24 changes: 12 additions & 12 deletions collector/config/otelcol-linux-hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ receivers:
- job_name: otel-collector
scrape_interval: 5s
static_configs:
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
hostmetrics:
collection_interval: 5s
scrapers:
Expand All @@ -36,11 +36,11 @@ exporters:
otlp/lightstep:
endpoint: ingest.lightstep.com:443
headers:
'lightstep-access-token': '${LS_TOKEN}'
"lightstep-access-token": "${LS_TOKEN}"
sending_queue:
enabled: true
num_consumers: 4
queue_size: 100
enabled: true
num_consumers: 4
queue_size: 100
# Send to HLA
servicenow/logs:
instance_logs_url: ${MID_INSTANCE_LOGS_URL}
Expand Down Expand Up @@ -68,14 +68,14 @@ extensions:
ws:
endpoint: https://opamp.lightstep.com/v1/opamp
headers:
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
service:
pipelines:
metrics/collector:
receivers: [prometheus/self]
processors: [batch, resourcedetection]
exporters: [debug]
metrics/host:
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
24 changes: 12 additions & 12 deletions collector/config/otelcol-macos-hostmetrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#
# Basic OpenTelemetry host metrics for macOS.
# Validated with v0.95.0 on 2/21/24
#
Expand All @@ -9,10 +9,10 @@ receivers:
- job_name: otel-collector
scrape_interval: 5s
static_configs:
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
hostmetrics:
collection_interval: 5s
# cpu and disk not supported by macOS
Expand All @@ -35,11 +35,11 @@ exporters:
otlp/lightstep:
endpoint: ingest.lightstep.com:443
headers:
'lightstep-access-token': '${LS_TOKEN}'
"lightstep-access-token": "${LS_TOKEN}"
sending_queue:
enabled: true
num_consumers: 4
queue_size: 100
enabled: true
num_consumers: 4
queue_size: 100
# Send to HLA
servicenow/logs:
instance_logs_url: ${MID_INSTANCE_LOGS_URL}
Expand Down Expand Up @@ -76,6 +76,6 @@ service:
processors: [batch, resourcedetection]
exporters: [debug]
metrics/host:
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
24 changes: 12 additions & 12 deletions collector/config/otelcol-windows-hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ receivers:
- job_name: otel-collector
scrape_interval: 5s
static_configs:
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
- labels:
collector_name: sn-collector
targets:
- 0.0.0.0:8888
hostmetrics:
collection_interval: 5s
scrapers:
Expand All @@ -36,11 +36,11 @@ exporters:
otlp/lightstep:
endpoint: ingest.lightstep.com:443
headers:
'lightstep-access-token': '${LS_TOKEN}'
"lightstep-access-token": "${LS_TOKEN}"
sending_queue:
enabled: true
num_consumers: 4
queue_size: 100
enabled: true
num_consumers: 4
queue_size: 100
# Send to HLA
servicenow/logs:
instance_logs_url: ${MID_INSTANCE_LOGS_URL}
Expand Down Expand Up @@ -68,14 +68,14 @@ extensions:
ws:
endpoint: https://opamp.lightstep.com/v1/opamp
headers:
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
"Authorization": "Bearer ${LS_OPAMP_API_KEY}"
service:
pipelines:
metrics/collector:
receivers: [prometheus/self]
processors: [batch, resourcedetection]
exporters: [debug]
metrics/host:
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
receivers: [hostmetrics]
processors: [batch, resourcedetection]
exporters: [debug]
8 changes: 4 additions & 4 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ make
goreleaser release --snapshot --rm-dist
```

To build for multiple platforms, this repository runs goreleaser automatically in a Github Action when a tag starting with `v` is pushed to the repository.
To build for multiple platforms, this repository runs goreleaser automatically in a Github Action when a tag starting with `v` is pushed to the repossitory.

```sh
git tag v0.0.1
git push origin --tags
# ... Github Action to build and released kicked off remotely
git tag v0.0.1
git push origin --tags
# ... Github Action to build and released kicked off remotely
```

0 comments on commit c9d7b17

Please sign in to comment.