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

Valider un pipeline d'observabilité

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

Présentation

Valider une configuration de pipeline sans créer ni mettre à jour de ressources. Renvoie une liste d'erreurs de validation, le cas échéant.

This endpoint requires the observability_pipelines_read permission.

Requête

Body Data (required)

Champ
Type
Description
data [required]
object

Schéma d'entrée représentant une configuration de pipeline d'observabilité. Utilisé dans les requêtes de création et de validation.

Réponse

OK

Response containing validation errors.

Champ
Type
Description
errors
[object]

The ValidationResponse errors.

Exemple de code

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