Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otelcol-contrib 0.92.0 (new formula) #160730

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Formula/o/otelcol-contrib.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
class OtelcolContrib < Formula
desc "OpenTelemetry Collector (contrib distribution)"
homepage "https://opentelemetry.io/docs/collector/"
url "https://github.com/open-telemetry/opentelemetry-collector-releases/archive/refs/tags/v0.92.0.tar.gz"
sha256 "1d1337870014a2e06e2edebf9381448fe0841758148e620a6e934cfbb3618e55"
license "Apache-2.0"
head "https://github.com/open-telemetry/opentelemetry-collector-releases.git", branch: "main"

depends_on "go" => :build

def install
ENV["distributions"] = "otelcol-contrib"
system "make", "build"
bin.install "distributions/otelcol-contrib/_build/otelcol-contrib" => "otelcol-contrib"
end

test do
require "net/http"

(testpath/"config.yaml").write <<~EOF
receivers:
otlp:
protocols:
http:
exporters:
logging:
verbosity: detailed
service:
pipelines:
metrics:
receivers: [otlp]
exporters: [logging]
EOF

fork do
exec "#{bin}/otelcol-contrib", "--config", (testpath/"config.yaml")
end

sleep 10

resp = Net::HTTP.post(URI("http://127.0.0.1:4318/v1/metrics"), "{}", {
"Content-Type": "application/json",
})
assert_equal true, (resp.is_a? Net::HTTPSuccess),
"HTTP request to OpenTelemetry Collector should succeed"
assert_equal "{\"partialSuccess\":{}}", resp.body,
"HTTP request to OpenTelemetry Collector should return a partial success"
end
end
Loading