]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/api/include/opentelemetry/trace/canonical_code.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / api / include / opentelemetry / trace / canonical_code.h
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 #pragma once
5
6 #include <cstdint>
7
8 #include "opentelemetry/version.h"
9
10 OPENTELEMETRY_BEGIN_NAMESPACE
11 namespace trace
12 {
13 enum class CanonicalCode : uint8_t
14 {
15 /**
16 * The operation completed successfully.
17 */
18 OK = 0,
19
20 /**
21 * The operation was cancelled (typically by the caller).
22 */
23 CANCELLED = 1,
24
25 /**
26 * Unknown error. An example of where this error may be returned is if a Status value received
27 * from another address space belongs to an error-space that is not known in this address space.
28 * Also errors raised by APIs that do not return enough error information may be converted to
29 * this error.
30 */
31 UNKNOWN = 2,
32
33 /**
34 * Client specified an invalid argument. Note that this differs from FAILED_PRECONDITION.
35 * INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the
36 * system (e.g., a malformed file name).
37 */
38 INVALID_ARGUMENT = 3,
39
40 /**
41 * Deadline expired before operation could complete. For operations that change the state of the
42 * system, this error may be returned even if the operation has completed successfully. For
43 * example, a successful response from a server could have been delayed long enough for the
44 * deadline to expire.
45 */
46 DEADLINE_EXCEEDED = 4,
47
48 /**
49 * Some requested entity (e.g., file or directory) was not found.
50 */
51 NOT_FOUND = 5,
52
53 /**
54 * Some entity that we attempted to create (e.g., file or directory) already exists.
55 */
56 ALREADY_EXISTS = 6,
57
58 /**
59 * The caller does not have permission to execute the specified operation. PERMISSION_DENIED
60 * must not be used for rejections caused by exhausting some resource (use RESOURCE_EXHAUSTED
61 * instead for those errors). PERMISSION_DENIED must not be used if the caller cannot be
62 * identified (use UNAUTHENTICATED instead for those errors).
63 */
64 PERMISSION_DENIED = 7,
65
66 /**
67 * Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system
68 * is out of space.
69 */
70 RESOURCE_EXHAUSTED = 8,
71
72 /**
73 * Operation was rejected because the system is not in a state required for the operation's
74 * execution. For example, directory to be deleted may be non-empty, an rmdir operation is
75 * applied to a non-directory, etc.
76 *
77 * A litmus test that may help a service implementor in deciding between FAILED_PRECONDITION,
78 * ABORTED, and UNAVAILABLE: (a) Use UNAVAILABLE if the client can retry just the failing call.
79 * (b) Use ABORTED if the client should retry at a higher-level (e.g., restarting a
80 * read-modify-write sequence). (c) Use FAILED_PRECONDITION if the client should not retry until
81 * the system state has been explicitly fixed. E.g., if an "rmdir" fails because the directory
82 * is non-empty, FAILED_PRECONDITION should be returned since the client should not retry unless
83 * they have first fixed up the directory by deleting files from it.
84 */
85 FAILED_PRECONDITION = 9,
86
87 /**
88 * The operation was aborted, typically due to a concurrency issue like sequencer check
89 * failures, transaction aborts, etc.
90 *
91 * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE.
92 */
93 ABORTED = 10,
94
95 /**
96 * Operation was attempted past the valid range. E.g., seeking or reading past end of file.
97 *
98 * Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed if the system
99 * state changes. For example, a 32-bit file system will generate INVALID_ARGUMENT if asked to
100 * read at an offset that is not in the range [0,2^32-1], but it will generate OUT_OF_RANGE if
101 * asked to read from an offset past the current file size.
102 *
103 * There is a fair bit of overlap between FAILED_PRECONDITION and OUT_OF_RANGE. We recommend
104 * using OUT_OF_RANGE (the more specific error) when it applies so that callers who are
105 * iterating through a space can easily look for an OUT_OF_RANGE error to detect when they are
106 * done.
107 */
108 OUT_OF_RANGE = 11,
109
110 /**
111 * Operation is not implemented or not supported/enabled in this service.
112 */
113 UNIMPLEMENTED = 12,
114
115 /**
116 * Internal errors. Means some invariants expected by underlying system has been broken. If you
117 * see one of these errors, something is very broken.
118 */
119 INTERNAL = 13,
120
121 /**
122 * The service is currently unavailable. This is a most likely a transient condition and may be
123 * corrected by retrying with a backoff.
124 *
125 * See litmus test above for deciding between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE.
126 */
127 UNAVAILABLE = 14,
128
129 /**
130 * Unrecoverable data loss or corruption.
131 */
132 DATA_LOSS = 15,
133
134 /**
135 * The request does not have valid authentication credentials for the operation.
136 */
137 UNAUTHENTICATED = 16,
138 };
139
140 } // namespace trace
141 OPENTELEMETRY_END_NAMESPACE