Class DatadogSites

java.lang.Object
codes.grow.packages.datadoglogs.DatadogSites

public final class DatadogSites extends Object
Datadog sites and the host resolver (API.md section 1).

Every site has two hosts: the logs intake https://http-intake.logs.<site> and the API https://api.<site>. The site is the API site, never the UI host ( app.datadoghq.com).


 DatadogSites.resolve("datadoghq.eu").intakeUrl(); // "https://http-intake.logs.datadoghq.eu"
 
  • Field Details

    • DEFAULT_SITE

      public static final String DEFAULT_SITE
      Default Datadog site (US1).
      See Also:
    • SITES

      public static final List<String> SITES
      Every site accepted by site / DD_SITE (the official OpenAPI servers enum).
  • Method Details

    • normalize

      public static String normalize(String site)
      Lower-cases and trims a site name; null or blank gives DEFAULT_SITE.
      Parameters:
      site - site name, may be null
      Returns:
      the normalized name
    • isKnown

      public static boolean isKnown(String site)
      Returns whether the site (after normalize(java.lang.String)) is a known Datadog site.
      Parameters:
      site - site name
      Returns:
      true for a site in SITES
    • resolve

      public static DatadogSites.SiteUrls resolve(String site)
      Resolves a site to its intake and API base URLs.
      Parameters:
      site - site name such as datadoghq.eu; null or blank means DEFAULT_SITE
      Returns:
      the base URLs
      Throws:
      ConfigException - for an unknown site