Skip to content

Commit

Permalink
Cleanup template rendering
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Crump <[email protected]>
  • Loading branch information
mkocher authored and acrmp committed Aug 3, 2023
1 parent 31c6cf9 commit e220bb0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 40 deletions.
46 changes: 26 additions & 20 deletions jobs/otel-collector-windows/templates/config.yml.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 127.0.0.1:<%= p('ingress.grpc.port') %>
tls:
client_ca_file: /var/vcap/jobs/otel-collector-windows/config/certs/otel-collector-ca.crt
cert_file: /var/vcap/jobs/otel-collector-windows/config/certs/otel-collector.crt
key_file: /var/vcap/jobs/otel-collector-windows/config/certs/otel-collector.key
min_version: "1.3"
<%=
otlp_grpc_endpoint = "127.0.0.1:#{p('ingress.grpc.port')}"

exporters: <%= YAML.dump(p('metric_exporters')).sub("---", "").gsub("\n", "\n ") %>
config = {
"receivers"=> {
"otlp"=>{
"protocols"=>{
"grpc"=>{
"endpoint"=>otlp_grpc_endpoint,
"tls"=>{
"client_ca_file"=>"/var/vcap/jobs/otel-collector-windows/config/certs/otel-collector-ca.crt",
"cert_file"=>"/var/vcap/jobs/otel-collector-windows/config/certs/otel-collector.crt",
"key_file"=>"/var/vcap/jobs/otel-collector-windows/config/certs/otel-collector.key",
"min_version"=>"1.3"
}
}
}
}
},
"exporters"=>p('metric_exporters'),
"service"=>{
"telemetry"=>{"metrics"=>{"level"=>"none"}},
"pipelines"=>{"metrics"=>{"receivers"=>["otlp"], "exporters"=>p('metric_exporters').keys}}
}
}

service:
telemetry:
metrics:
level: none
pipelines:
metrics:
receivers:
- otlp
exporters: <%= YAML.dump(p('metric_exporters').keys).sub("---", "").gsub("\n", "\n ") %>
YAML::dump(config)
%>
46 changes: 26 additions & 20 deletions jobs/otel-collector/templates/config.yml.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
receivers:
otlp:
protocols:
grpc:
endpoint: 127.0.0.1:<%= p('ingress.grpc.port') %>
tls:
client_ca_file: /var/vcap/jobs/otel-collector/config/certs/otel-collector-ca.crt
cert_file: /var/vcap/jobs/otel-collector/config/certs/otel-collector.crt
key_file: /var/vcap/jobs/otel-collector/config/certs/otel-collector.key
min_version: "1.3"
<%=
otlp_grpc_endpoint = "127.0.0.1:#{p('ingress.grpc.port')}"

exporters: <%= YAML.dump(p('metric_exporters')).sub("---", "").gsub("\n", "\n ") %>
config = {
"receivers"=> {
"otlp"=>{
"protocols"=>{
"grpc"=>{
"endpoint"=>otlp_grpc_endpoint,
"tls"=>{
"client_ca_file"=>"/var/vcap/jobs/otel-collector/config/certs/otel-collector-ca.crt",
"cert_file"=>"/var/vcap/jobs/otel-collector/config/certs/otel-collector.crt",
"key_file"=>"/var/vcap/jobs/otel-collector/config/certs/otel-collector.key",
"min_version"=>"1.3"
}
}
}
}
},
"exporters"=>p('metric_exporters'),
"service"=>{
"telemetry"=>{"metrics"=>{"level"=>"none"}},
"pipelines"=>{"metrics"=>{"receivers"=>["otlp"], "exporters"=>p('metric_exporters').keys}}
}
}

service:
telemetry:
metrics:
level: none
pipelines:
metrics:
receivers:
- otlp
exporters: <%= YAML.dump(p('metric_exporters').keys).sub("---", "").gsub("\n", "\n ") %>
YAML::dump(config)
%>

0 comments on commit e220bb0

Please sign in to comment.