Source file conventions.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
(** Semantic conventions.

    {{:https://opentelemetry.io/docs/specs/semconv/}
     https://opentelemetry.io/docs/specs/semconv/} *)

module Attributes = struct
  module Process = struct
    module Runtime = struct
      let name = "process.runtime.name"

      let version = "process.runtime.version"

      let description = "process.runtime.description"
    end
  end

  (** https://opentelemetry.io/docs/specs/semconv/attributes-registry/code/ *)
  module Code = struct
    (** Int *)
    let column = "code.column"

    let filepath = "code.filepath"

    let function_ = "code.function"

    (** int *)
    let line = "code.lineno"

    let namespace = "code.namespace"

    let stacktrace = "code.stacktrace"
  end

  module Service = struct
    let name = "service.name"

    let namespace = "service.namespace"

    let instance_id = "service.instance.id"

    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

  (** https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/host.md
  *)
  module Host = struct
    let id = "host.id"

    let name = "host.name"

    let type_ = "host.type"

    let arch = "host.arch"

    let ip = "host.ip"

    let mac = "host.mac"

    let image_id = "host.image.id"

    let image_name = "host.image.name"

    let image_version = "host.image.version"
  end
end

module Metrics = struct
  module Process = struct
    module Runtime = struct
      module Ocaml = struct
        module GC = struct
          let compactions = "process.runtime.ocaml.gc.compactions"

          let major_collections = "process.runtime.ocaml.gc.major_collections"

          let major_heap = "process.runtime.ocaml.gc.major_heap"

          let minor_allocated = "process.runtime.ocaml.gc.minor_allocated"

          let minor_collections = "process.runtime.ocaml.gc.minor_collections"
        end
      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