惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
N
News and Events Feed by Topic
T
Troy Hunt's Blog
PCI Perspectives
PCI Perspectives
W
WeLiveSecurity
N
News | PayPal Newsroom
Recent Commits to openclaw:main
Recent Commits to openclaw:main
V2EX - 技术
V2EX - 技术
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threat Research - Cisco Blogs
L
LINUX DO - 热门话题
Cloudbric
Cloudbric
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
Y
Y Combinator Blog
L
LangChain Blog
Recorded Future
Recorded Future
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
Attack and Defense Labs
Attack and Defense Labs
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
小众软件
小众软件
H
Hacker News: Front Page
The Hacker News
The Hacker News
T
Tailwind CSS Blog
The Register - Security
The Register - Security
Hacker News: Ask HN
Hacker News: Ask HN
P
Privacy & Cybersecurity Law Blog
P
Palo Alto Networks Blog
S
Securelist
腾讯CDC
雷峰网
雷峰网
G
Google Developers Blog
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
Arctic Wolf
www.infosecurity-magazine.com
www.infosecurity-magazine.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
阮一峰的网络日志
阮一峰的网络日志
AI
AI

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis Monitor Aruba Central in Datadog How we centralize and remediate risks with Datadog Case Management Accelerate incident response with Datadog and ServiceNow Monitor your application and network load balancer logs Understanding Karpenter architecture for Kubernetes autoscaling Tools for collecting metrics and logs from Karpenter Monitor Karpenter with Datadog What your product data is actually saying Key metrics for monitoring Karpenter Securing Datadog’s platform in the AI age: The role of observability data Four ways engineering teams use the Datadog MCP Server to power AI agents Approaching your observability migration with the right mindset Meet the new Bits AI SRE: Deeper reasoning, twice as fast Key learnings from the 2026 State of DevSecOps study Use plain English to query your multi-cloud infrastructure in Resource Catalog Simplifying troubleshooting across the user journey with Datadog Synthetic Monitoring Protect your OCI resources with Datadog Cloud Security This Month in Datadog - February 2026 Amazon EC2 security: How misconfigured and public AMIs expand your cloud attack surface Enable end-to-end visibility into your Java apps with a single command Measure and improve mobile app startup performance with Datadog RUM Evaluating our AI Guard application to improve quality and control cost Identify untested code across every level of your codebase Make use of guardrail metrics and stop babysitting your releases Monitor Versa Networks SD-WAN performance in Datadog Improve performance and reliability with APM Recommendations Remediate transitive vulnerabilities faster with Datadog Software Composition Analysis Generate audit-ready vulnerability and compliance reports with Datadog Sheets Monitor Fortinet FortiManager performance in Datadog Improve test coverage across codebases with Datadog Code Coverage Move fast, don’t break things: Consistent testing standards at scale Enrich logs with ServiceNow CMDB context before routing to any SIEM or logging tool Monitor Lustre with Datadog Make faster, better product decisions with Datadog Product Analytics Surface and remediate runtime posture issues with Workload Protection Findings Protect agentic AI applications with Datadog AI Guard How to optimize JavaScript code with CSS Trace Google Pub/Sub workloads in Cloud Run with Datadog Detect human names in logs with ML in Sensitive Data Scanner How we cut our NLQ agent debugging time from hours to minutes with LLM Observability Debug PostgreSQL query latency faster with EXPLAIN ANALYZE in Datadog Database Monitoring Datadog acquires Propolis Unify and correlate frontend and backend data with retention filters Scale compliance across global frameworks with Datadog Cloud Security Monitor Arista VeloCloud SD-WAN performance with Datadog Building reliable dashboard agents with Datadog LLM Observability Simplify log collection and aggregation for MSSPs with Datadog Observability Pipelines Mitigation for Node.js denial-of-service vulnerability affecting Datadog APM Automate flaky test fixes with the Bits AI Dev Agent and Test Optimization How we built an AI SRE agent that investigates like a team of engineers Datadog integrations 2025 recap: Observability for AI, security, and hybrid cloud Design effective executive dashboards with Datadog Implement dbt data quality checks with dbt-expectations Bring faster visibility into AWS Lambda functions with remote instrumentation Troubleshoot faster with the GitLab Source Code integration in Datadog How Cambia Health Solutions saved $30,000 monthly with Cloud Cost Management and the Datadog Resource Catalog Normalize any logs for Cloud SIEM with Datadog's OCSF processor Optimizing Datadog at scale: Cost-efficient observability at Zendesk Detect, diagnose, and resolve network issues easily with CNM Network Health Connect engineering errors to user impact in early-stage products Cilium configuration for Kubernetes operations at scale Designing feedback loops for progressive delivery Ship features faster and safer with Datadog Feature Flags Choosing the right OpenTelemetry Collector distribution Route your monitor alerts with Datadog monitor notification rules Automate Cloud SIEM investigations with Bits AI Security Analyst Cloud threat detection: How to identify risky activity across control and data planes Collecting Kafka performance metrics Monitoring Kafka with Datadog Monitoring Kafka performance metrics
Datadog API client libraries now available for Java and Go
2020-07-20 · via Datadog | The Monitor blog
Jordan Obey

Jordan Obey

Client libraries are collections of code that make it easier for developers to write flexible and efficient applications that interface with APIs. Datadog provides client libraries so you can programmatically interact with our API to customize dashboards, search metrics, create alerts, and perform other tasks. We’re pleased to announce that we’ve developed and open-sourced two new client libraries for Java and Go in addition to our existing Ruby and Python libraries.

Now, development teams who work closely with either Java or Go can build applications that programmatically execute Datadog-specific tasks, including building dashboards, retrieving metric data, and managing your account. These libraries were generated with the OpenAPI Generator and adhere to the OpenAPI Specification (formerly known as the Swagger Specification), which means developers can easily contribute to them.

In this post we’ll show you how to import our Java and Go client libraries into your application code. Then, we’ll look at a few usage examples, including how to get and update dashboards, list metrics, and retrieve logs. Please note that while the code samples included in this post are written in Go, the same functionality is available in Java. You can use our API reference documentation for more guidance on using any of these libraries.

Getting started with the Java and Go client libraries

Once you’ve installed the Datadog Agent in your environment, client libraries can be used to send and view data through the Datadog API. To use the Go client library in your application, you’ll simply need to import it with the following:

import "github.com/DataDog/datadog-api-client-go/api/<VERSION>/datadog"

If you’re a Java user, make sure you have the latest versions of Maven or Gradle before getting started here. In order for your client application to successfully interact with the Datadog API, you’ll need to configure it with a valid API key (for read access) and an application key (for write access). There are a few ways to do this, such as importing the keys as environment variables, as in the following Go example:

package main

import (

"context"

"fmt"

"os"

datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"

)

func main() {

ctx := context.WithValue(

context.Background(),

datadog.ContextAPIKeys,

map[string]datadog.APIKey{

"apiKeyAuth": {

Key: os.Getenv("DD_CLIENT_API_KEY"),

},

"appKeyAuth": {

Key: os.Getenv("DD_CLIENT_APP_KEY"),

},

},

)

};

Then, you can validate your API key using the following:

configuration := datadog.NewConfiguration()

api_client := datadog.NewAPIClient(configuration)

resp, r, err := api_client.AuthenticationApi.Validate(ctx).Execute()

if err != nil {

fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationApi.Validate`: %v\n", err)

fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)

}

fmt.Fprintf(os.Stdout, "Response from `AuthenticationApi.Validate`: %v\n", resp)

}

Java and Go client libraries in action

Our client libraries enable you to interact with the Datadog API to perform a variety of actions. In the next few sections, we’ll go over some examples, including how to:

Retrieve and update dashboards

All of Datadog’s dashboards are available as JSON objects that you can retrieve and update programmatically. Each dashboard has a unique ID, which you’ll need to reference when sending a request. You can access a dashboard’s ID either from it’s URL path or from the id parameter of its JSON string. Once you have a dashboard’s ID, you can retrieve its JSON. For example, with the Go client library, you can use GetDashboard(), as in the following:

package main

import (

"context"

"fmt"

"os"

datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"

)

func main() {

[...]

dashboardId := "<DASHBOARD_ID>"

configuration := datadog.NewConfiguration()

api_client := datadog.NewAPIClient(configuration)

resp, r, err := api_client.DashboardsApi.GetDashboard(ctx, dashboardId).Execute()

if err != nil {

fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.GetDashboard`: %v\n", err)

fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)

}

fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.GetDashboard`: %v\n", resp)

}

You can also easily update a dashboard using UpdateDashboard() (or updateDashboard() in Java). For example, if you want to change a dashboard’s description or one of its timeseries widgets, you can modify the dashboard’s JSON. Then, simply include that dashboard’s ID and the updated JSON as arguments when you call the function.

Retrieve and search for metrics

Our client libraries enable you to send requests for a full list of metrics that are being actively reported to your Datadog account. Like dashboards, metrics are available via our API as JSON strings to make them easy to parse and read. If, for example, you’re interested in piping metrics from Datadog into your own data analysis workflows you can use the following Go code to request a full list of metrics using ListActiveMetrics():

package main

import (

"context"

"fmt"

"os"

datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"

)

func main() {

[...]

from := 900

host := "<EXAMPLE_HOST>"

configuration := datadog.NewConfiguration()

api_client := datadog.NewAPIClient(configuration)

resp, r, err := api_client.MetricsApi.ListActiveMetrics(ctx, from).Host(host).Execute()

if err != nil {

fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.ListActiveMetrics`: %v\n", err)

fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)

}

fmt.Fprintf(os.Stdout, "Response from `MetricsApi.ListActiveMetrics`: %v\n", resp)

}

Retrieve log data

Logs provide you with vital information about issues you may need to troubleshoot. With our client libraries, you can query Datadog’s API for logs using the same syntax as you would in the Log Explorer. For instance, if you want a list of error logs from a web service, you can use the LogsListRequest() function and include a query like "service:web* AND @http.status_code:[500 TO 599]" in your Go client library request as shown below:

package main

import (

"context"

"fmt"

"os"

datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"

)

func main() {

[...]

body := datadog.LogsListRequest{Index: "<EXAMPLE_INDEX>", Limit: 123, Query: "service:web* AND @http.status_code:[500 TO 599]", Sort: datadog.LogsSort{}, StartAt: "StartAt_example", Time: datadog.LogsListRequest_time{From: "2020-01-01 12:00:00

", Timezone: "UTC-4", To: "2020-02-01 12:00:00"}}

configuration := datadog.NewConfiguration()

api_client := datadog.NewAPIClient(configuration)

resp, r, err := api_client.LogsApi.ListLogs(ctx, body).Execute()

if err != nil {

fmt.Fprintf(os.Stderr, "Error when calling `LogsApi.ListLogs`: %v\n", err)

fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)

}

fmt.Fprintf(os.Stdout, "Response from `LogsApi.ListLogs`: %v\n", resp)

}

In addition to the query parameter, you must include a Time, or the timeframe to retrieve logs. For more information about these and other optional parameters, you can view our documentation.

It’s important to note that log lists have a maximum length of 1,000 logs, though you can reduce this with the limit parameter (123 in the example above). If your log list is longer than the limit, you’ll need to use our log pagination feature. This returns logs with a nextLogId parameter that you can use to query the next set of logs in your list (by including a startAt parameter in your next query set to the value returned in nextLogId).

More libraries, more possibilities

With these new client libraries for Java and Go, you can interact with Datadog’s API to programmatically execute tasks, helping you monitor data from over 1,000 integrations. While Java and Go libraries are currently our only two official API client libraries using the OpenAPI Specification, we will soon update our other API client libraries for languages like Python and Ruby so that they use the OpenAPI Specification as well, making them easy to adopt and contribute to.

If you have a Datadog account and would like to start using our client libraries, you can get a full list of them here. If you’re not already using Datadog, sign up today for a 14-day free trial.