For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/observability-pipelines/validate-an-observability-pipeline.md. A documentation index is available at /llms.txt.
Language
Datadog site

Validate an observability pipeline

POSThttps://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validatehttps://api.us3.datadoghq.com/api/v2/obs-pipelines/pipelines/validatehttps://api.us5.datadoghq.com/api/v2/obs-pipelines/pipelines/validatehttps://api.datadoghq.eu/api/v2/obs-pipelines/pipelines/validatehttps://api.ap1.datadoghq.com/api/v2/obs-pipelines/pipelines/validatehttps://api.ap2.datadoghq.com/api/v2/obs-pipelines/pipelines/validatehttps://api.uk1.datadoghq.com/api/v2/obs-pipelines/pipelines/validatehttps://api.ddog-gov.com/api/v2/obs-pipelines/pipelines/validatehttps://api.us2.ddog-gov.com/api/v2/obs-pipelines/pipelines/validate

Overview

Validates a pipeline configuration without creating or updating any resources. Returns a list of validation errors, if any.

This endpoint requires the observability_pipelines_read permission.

Request

Body Data (required)

Field
Type
Description
data [required]
object

Contains the the pipeline configuration.

Response

OK

Response containing validation errors.

Field
Type
Description
errors
[object]

The ValidationResponse errors.

Code Example

Validate a metrics pipeline with enrichment table processor file lookup returns "OK" response
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "file": {
                  "encoding": {
                    "delimiter": ",",
                    "type": "csv",
                    "includes_headers": true
                  },
                  "key": {
                    "column": "service",
                    "source": {
                      "type": "tag",
                      "name": "service"
                    }
                  },
                  "path": "/etc/enrichment/lookup.csv"
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table File Lookup"
    },
    "type": "pipelines"
  }
}
EOF
Validate a metrics pipeline with enrichment table processor reference table returns "OK" response
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "datadog-agent-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "enrichment-table-processor",
                "include": "*",
                "type": "enrichment_table",
                "reference_table": {
                  "table_id": "metric-enrichment",
                  "key": {
                    "source": {
                      "type": "metric_name"
                    }
                  },
                  "columns": [
                    "environment",
                    "team"
                  ]
                }
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "datadog-agent-source",
            "type": "datadog_agent"
          }
        ]
      },
      "name": "Metrics Pipeline with Enrichment Table Reference Table"
    },
    "type": "pipelines"
  }
}
EOF
Validate a metrics pipeline with opentelemetry source returns "OK" response
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/obs-pipelines/pipelines/validate" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "config": {
        "pipeline_type": "metrics",
        "destinations": [
          {
            "id": "datadog-metrics-destination",
            "inputs": [
              "my-processor-group"
            ],
            "type": "datadog_metrics"
          }
        ],
        "processor_groups": [
          {
            "enabled": true,
            "id": "my-processor-group",
            "include": "*",
            "inputs": [
              "opentelemetry-source"
            ],
            "processors": [
              {
                "enabled": true,
                "id": "filter-processor",
                "include": "env:production",
                "type": "filter"
              }
            ]
          }
        ],
        "sources": [
          {
            "id": "opentelemetry-source",
            "type": "opentelemetry"
          }
        ]
      },
      "name": "Metrics OTel Pipeline"
    },
    "type": "pipelines"
  }
}
EOF