Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
fail-fast: false
matrix:
version:
- "1"
- 'lts'
os:
- ubuntu-latest
- windows-latest
- macOS-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down Expand Up @@ -58,10 +58,10 @@ jobs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1"
version: 'lts'
- name: Build docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
Expand Down
12 changes: 9 additions & 3 deletions src/exporter/prometheus/src/OpenTelemetryExporterPrometheus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ export PrometheusExporter
using OpenTelemetrySDK
using HTTP

function handler(io, provider::Ref{MeterProvider}, resource_to_telemetry_conversion)
function handler(
io,
provider::Ref{MeterProvider},
resource_to_telemetry_conversion,
with_timestamp,
)
for ins in provider[].async_instruments
ins()
end
HTTP.setstatus(io, 200)
HTTP.setheader(io, "Content-Type" => "text/plain")
HTTP.startwrite(io)
text_based_format(io, provider[], resource_to_telemetry_conversion)
text_based_format(io, provider[], resource_to_telemetry_conversion; with_timestamp)
nothing
end

Expand Down Expand Up @@ -42,6 +47,7 @@ mutable struct PrometheusExporter <: OpenTelemetrySDK.AbstractExporter
port = OTEL_EXPORTER_PROMETHEUS_PORT(),
resource_to_telemetry_conversion = false,
path = "/metrics",
with_timestamp = true,
kw...,
)
provider = Ref{MeterProvider}()
Expand All @@ -51,7 +57,7 @@ mutable struct PrometheusExporter <: OpenTelemetrySDK.AbstractExporter
router,
"GET",
path,
io -> handler(io, provider, resource_to_telemetry_conversion),
io -> handler(io, provider, resource_to_telemetry_conversion, with_timestamp),
)
server = HTTP.serve!(router, host, port; stream = true, kw...)

Expand Down
Loading