Package codes.grow.packages.datadogapm
Class DatadogSites
java.lang.Object
codes.grow.packages.datadogapm.DatadogSites
Datadog sites and the query API base URL (API.md section 0). Same site handling as the
datadog-logs package; this copy is kept in sync by hand (no cross-repository runtime
dependency).-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Datadog sites of the official OpenAPI spec (servers enum).static final StringDefault Datadog site (US1). -
Method Summary
Modifier and TypeMethodDescriptionstatic StringapiUrlForSite(String site) Returns the API base URL of a site:https://api.<site>.static booleanisDatadogSite(String site) Whethersiteis one ofDATADOG_SITES.static StringnormalizeSite(String site) Lower-cases and trims a site name.static StringvalidateSite(String site) Validates a site name and returns it normalized.
-
Field Details
-
DEFAULT_SITE
Default Datadog site (US1).- See Also:
-
DATADOG_SITES
The Datadog sites of the official OpenAPI spec (servers enum). Other host names are accepted too (the spec's "any Datadog deployment" server), but never a scheme, port or path.
-
-
Method Details
-
normalizeSite
Lower-cases and trims a site name.- Parameters:
site- site name- Returns:
- the normalized name (
""fornull)
-
isDatadogSite
Whethersiteis one ofDATADOG_SITES.- Parameters:
site- site name- Returns:
- true for a known site
-
validateSite
Validates a site name and returns it normalized.- Parameters:
site- site name such asdatadoghq.eu- Returns:
- the normalized site
- Throws:
ConfigException- for a value with a scheme, port, path or other non-host characters (for examplehttps://app.datadoghq.com)
-
apiUrlForSite
Returns the API base URL of a site:https://api.<site>.DatadogSites.apiUrlForSite("datadoghq.eu"); // "https://api.datadoghq.eu"- Parameters:
site- site name;nullor blank meansDEFAULT_SITE- Returns:
- the API base URL
- Throws:
ConfigException- for an invalid site
-