Skip to content

Commit

Permalink
some HTTP semantic conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 6, 2024
1 parent 6ff9dc2 commit 1686f38
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/core/opentelemetry.ml
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,26 @@ module Conventions = struct

let version = "service.version"
end

module HTTP = struct
let error_type = "error.type"

let request_method = "http.request.method"

let route = "http.route"

let url_full = "url.full"

(** HTTP status code, int *)
let response_status_code = "http.response.status_code"

let server_address = "server.address"

let server_port = "server.port"

(** http or https *)
let url_scheme = "url.scheme"
end
end

module Metrics = struct
Expand All @@ -532,6 +552,31 @@ module Conventions = struct
end
end
end

(** https://opentelemetry.io/docs/specs/semconv/http/ *)
module HTTP = struct
module Server = struct
let request_duration = "http.server.request.duration"

let active_requests = "http.server.active_requests"

(** Histogram *)
let request_body_size = "http.server.request.body.size"

(** Histogram *)
let response_body_size = "http.server.response.body.size"
end

module Client = struct
let request_duration = "http.client.request.duration"

(** Histogram *)
let request_body_size = "http.client.request.body.size"

(** Histogram *)
let response_body_size = "http.client.response.body.size"
end
end
end
end

Expand Down

0 comments on commit 1686f38

Please sign in to comment.