Skip to content

Commit

Permalink
Reserve metric exporter name prefix
Browse files Browse the repository at this point in the history
- Error when rendering OTel Collector config if the component identifier
  for metric exporters contains '/cf-internal'.
- Reserving this name prefix for potential later use.
  • Loading branch information
acrmp committed Aug 16, 2023
1 parent 71f185b commit b1c1005
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions jobs/otel-collector-windows/templates/config.yml.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<%=
otlp_grpc_endpoint = "127.0.0.1:#{p('ingress.grpc.port')}"
if p('metric_exporters').keys.any?{|k| k.include?('/cf-internal')}
raise 'Metric exporters cannot be defined under cf-internal namespace'
end

config = {
"receivers"=> {
"otlp"=>{
"protocols"=>{
"grpc"=>{
"endpoint"=>otlp_grpc_endpoint,
"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",
Expand Down
6 changes: 4 additions & 2 deletions jobs/otel-collector/templates/config.yml.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<%=
otlp_grpc_endpoint = "127.0.0.1:#{p('ingress.grpc.port')}"
if p('metric_exporters').keys.any?{|k| k.include?('/cf-internal')}
raise 'Metric exporters cannot be defined under cf-internal namespace'
end

config = {
"receivers"=> {
"otlp"=>{
"protocols"=>{
"grpc"=>{
"endpoint"=>otlp_grpc_endpoint,
"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",
Expand Down

0 comments on commit b1c1005

Please sign in to comment.