summaryrefslogtreecommitdiffstats
path: root/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml
blob: 6679a8066b8511411d32a2092fac0b01e58e9c5f (plain)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

---
$schema: http://json-schema.org/draft-07/schema#
title: Pings
description: |
  Schema for the pings.yaml files for Mozilla's Glean telemetry SDK.

  The top-level of the `pings.yaml` file has a key defining the name of each
  ping. The values contain metadata about that ping. Ping names must be
  kebab-case per https://docs.telemetry.mozilla.org/cookbooks/new_ping.html

$id: moz://mozilla.org/schemas/glean/pings/2-0-0

definitions:
  dotted_snake_case:
    type: string
    pattern: "^[a-z_][a-z0-9_]{0,29}(\\.[a-z_][a-z0-9_]{0,29})*$"
    maxLength: 40
  # Prior to version 2.0.0 of the schema, special ping names with underscores
  # were also supported.
  kebab_case:
    type: string
    pattern: "^[a-z][a-z0-9-]{0,29}$"

type: object

propertyNames:
  allOf:
    - anyOf:
        - $ref: "#/definitions/kebab_case"
        - enum: ['$schema', 'no_lint']
    - not:
        enum: ['all-pings']

properties:
  $schema:
    type: string
    format: url

  no_lint:
    title: Lint checks to skip globally
    description: |
      This parameter lists any lint checks to skip for this whole file.
    type: array
    items:
      type: string

additionalProperties:
  type: object
  properties:
    description:
      title: Description
      description: |
        **Required.**

        A textual description of the purpose of this ping and what it contains.

        Descriptions may contain [markdown
        syntax](https://www.markdownguide.org/basic-syntax/).
      type: string

    metadata:
      title: Metadata
      description: |
        Additional metadata about this ping. Currently limited to a list of
        tags.
      type: object
      properties:
        tags:
          title: Tags
          description: Which tags are specified for this ping.
          type: array
          items:
            type: string
            maxLength: 80
        precise_timestamps:
          title: Precise Timestamps
          description: |
            When `true` Glean uses millisecond-precise timestamps for
            the ping's start/end time (the default).
            When `false` Glean uses minute-precise timestamps for
            the ping's start/end time.
          type: boolean
        include_info_sections:
          title: Include Info Sections
          description: |
            When `true`, assemble and include the `client_info` and `ping_info`
            sections in the ping on submission.
            When `false`, omit the `client_info` and `ping_info` sections when
            assembling the ping on submission.
            Defaults to `true`.

            Interaction with `include_client_id`: `include_client_id` only takes
            effect when `metadata.include_info_sections` is `true`.
          type: boolean

      default: {}

    include_client_id:
      title: Include client id
      description: |
        **Required.**

        When `true`, include the `client_id` value in the ping.

        Interaction with `metadata.include_info_sections`: `include_client_id`
        only takes effect when `metadata.include_info_sections` is `true`.
      type: boolean

    send_if_empty:
      title: Send if empty
      description: |
        When `false` a ping is sent only if it contains data (the default).
        When `true` a ping is sent even if it contains no data.
      type: boolean

    notification_emails:
      title: Notification emails
      description: |
        **Required.**

        A list of email addresses to notify for important events with the
        ping or when people with context or ownership for the ping need to
        be contacted.
      type: array
      minItems: 1
      items:
        type: string
        format: email

    bugs:
      title: Related bugs
      description: |
        **Required.**

        A list of bugs (e.g. Bugzilla and Github) that are relevant to this
        ping, e.g., tracking its original implementation or later changes to
        it.

        It must be a URI to a bug page in a tracker.

        Prior to version 2.0.0 of the schema, bugs could also be integers.
      type: array
      minItems: 1
      items:
        type: string
        format: uri

    data_reviews:
      title: Review references
      description: |
        **Required.**

        A list of URIs to any data collection reviews relevant to the ping.
      type: array
      items:
        type: string
        format: uri

    reasons:
      title: The reasons this ping can be sent.
      description: |
        A list of reasons that the ping might be triggered. Sent in the ping's
        `ping_info.reason` field.

        Specified as a mapping from reason codes (which are short strings), to
        a textual description of the reason.
      type: object
      propertyNames:
        type: string
        maxLength: 30
      additionalProperties:
        type: string

    no_lint:
      title: Lint checks to skip
      description: |
        This parameter lists any lint checks to skip for this metric only.
      type: array
      items:
        type: string

  required:
    - description
    - include_client_id
    - bugs
    - notification_emails
    - data_reviews

  additionalProperties: false