### Start Test Client Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/README.md Commands to install dependencies and run the Vite development server for the test client. ```bash cd atlas-lsp/test-client npm install npm run dev ``` -------------------------------- ### Full Glossary Specification Example Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/GLOSSARY_SPEC.md A comprehensive example demonstrating the definition of common infrastructure tags and an example metric. This includes tag keys with descriptions and categories, specific tag value definitions, and metric definitions with units, categories, and types. ```json { "id": "common", "description": "Common infrastructure tags and example metrics.", "tagKeys": { "app": { "description": "Application name.", "category": "infrastructure" }, "cluster": { "description": "Specific deployment of an application, typically app-stack-detail.", "category": "infrastructure" }, "region": { "description": "Cloud region where the instance is running.", "category": "infrastructure", "values": ["us-east-1", "us-west-2", "eu-west-1"], "valuesType": "examples" }, "node": { "description": "Instance identifier.", "category": "infrastructure" }, "statistic": { "description": "Component of a conceptual type (count, totalTime, gauge, etc.).", "category": "type-system", "link": "https://netflix.github.io/atlas-docs/asl/conceptual-types/", "valuesType": "enum", "values": [ "count", "totalTime", "totalOfSquares", "max", "gauge", "activeTasks", "duration", "totalAmount", "percentile" ] } }, "tagValues": { "statistic=count": { "description": "Rate of events per second." }, "statistic=totalTime": { "description": "Total time in seconds spent on events per second." }, "statistic=gauge": { "description": "Sampled value at a point in time." }, "statistic=activeTasks": { "description": "Number of currently in-progress long tasks." } }, "metrics": { "http.req.complete": { "description": "Timer for completed HTTP requests.", "unit": "seconds", "category": "http", "type": "timer" }, "sys.cpu.utilization": { "description": "CPU utilization as a percentage.", "unit": "percent", "category": "system/cpu", "type": "gauge", "tags": { "id": { "description": "CPU mode (user, system, iowait, etc.).", "values": ["user", "system", "nice", "iowait", "irq", "softirq", "steal", "idle"], "valuesType": "examples" } } } } } ``` -------------------------------- ### Run Atlas LSP Server Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/README.md Command to start the Atlas LSP server for testing purposes. ```bash project/sbt 'atlas-lsp/test:runMain com.netflix.atlas.lsp.AslLspRunner' ``` -------------------------------- ### External Glossary File Configuration Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/GLOSSARY_SPEC.md Example configuration for specifying external glossary file paths or URLs. ```hocon atlas.lsp.glossary.files = [ "/path/to/team-glossary.json" ] ``` -------------------------------- ### Monaco Editor LSP Client Setup Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/README.md JavaScript code to establish a WebSocket connection and initialize the Monaco LSP client. ```javascript const ws = new WebSocket('ws://localhost:7102'); const transport = monaco.lsp.WebSocketTransport.fromWebSocket(ws); new monaco.lsp.MonacoLspClient(transport); ``` -------------------------------- ### Querying by Specific Metric Source: https://github.com/netflix/atlas/blob/main/atlas-core/src/test/resources/queries.txt This example shows how to query for a specific metric, 'sps', within a given time range and timezone. ```APIDOC ## GET /api/v1/graph (Specific Metric Query) ### Description Retrieves data for a specific metric, such as 'sps'. ### Method GET ### Endpoint /api/v1/graph ### Parameters #### Query Parameters - **e** (string) - Required - The end time for the data query. - **s** (string) - Required - The start time for the data query. - **q** (string) - Required - The query string, e.g., 'name,sps,:eq'. - **tz** (string) - Optional - The timezone for the time range. ### Request Example ```http GET /api/v1/graph?e=2015-03-08T08:00&s=e-12h&q=name,sps,:eq&tz=US/Pacific&tz=UTC ``` ### Response #### Success Response (200) Returns graph data for the specified metric. ``` -------------------------------- ### Glossary File in JAR Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/GLOSSARY_SPEC.md Example layout for including a glossary fragment within a Java Archive (JAR) file. ```plaintext mylib.jar └── META-INF/ └── atlas/ └── glossary/ └── mylib-metrics.json ``` -------------------------------- ### Basic Graph Query Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md This example shows a basic query to the /api/v1/graph endpoint, specifying a time range and a simple query string. ```APIDOC ## GET /api/v1/graph ### Description Retrieves graph data based on specified time range and query parameters. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range (e.g., 'e-1d' for 1 day ago). - **e** (string) - Required - End time for the data range (e.g., '2012-01-01T00:00'). - **q** (string) - Required - The query string defining the data to fetch and how to process it. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=name,sps,:eq,:sum,(,),:offset,f00,:color ``` ### Response #### Success Response (200) - The response format depends on the query parameters and may include time-series data suitable for graphing. ``` -------------------------------- ### Basic Graph Query Source: https://github.com/netflix/atlas/blob/main/atlas-core/src/test/resources/queries.txt This is a basic example of querying the graph endpoint. It specifies an end time, a start time relative to the end time, a timezone, and a query string for data selection and aggregation. It also includes parameters for height and width of the graph. ```APIDOC ## GET /api/v1/graph ### Description Retrieves time-series data and visualizes it as a graph. Supports various parameters for data selection, time range, aggregation, and visualization options. ### Method GET ### Endpoint /api/v1/graph ### Parameters #### Query Parameters - **e** (string) - Required - The end time for the data query (ISO 8601 format). - **s** (string) - Optional - The start time for the data query (e.g., 'e-12h' for 12 hours before the end time). - **tz** (string) - Optional - The timezone for the time range (e.g., 'UTC', 'US/Pacific'). Can be specified multiple times. - **q** (string) - Required - The query string defining the data to fetch and how to process it. - **h** (integer) - Optional - The height of the graph in pixels. - **w** (integer) - Optional - The width of the graph in pixels. - **stack** (integer) - Optional - Enables stacked area chart (typically 1). - **palette** (string) - Optional - Specifies the color palette for the graph (e.g., 'blues', 'greens', 'colors:1a9850,91cf60,...'). - **no_legend** (integer) - Optional - Disables the legend (typically 1). - **vision** (string) - Optional - Specifies a color vision simulation mode (e.g., 'normal', 'deuteranopia'). ### Request Example ```http GET /api/v1/graph?e=2012-01-01T12:00&s=e-12h&tz=UTC&q=nf.cluster,alerttest,:eq,name,requestsPerSecond,:eq,:and,:sum,:dup,1w,:offset,:over,2w,:offset,:add,:over,3w,:offset,:add,3,:div,:2over,:swap,:over,:sub,:abs,:swap,:div,100,:mul,:rot,requestsPerSecond,:legend,:rot,average+for+previous+3+weeks,:legend,:rot,:area,40,:alpha,percent+delta,:legend&h=150&w=750 ``` ### Response #### Success Response (200) Returns an image of the graph or data in a format suitable for visualization. ``` -------------------------------- ### Data Rate Message Example Source: https://github.com/netflix/atlas/blob/main/atlas-eval/README.md Illustrates the structure of a data rate message emitted by the library, showing input, intermediate, and output data sizes per DataSource and step. ```json5 { "id": "_", "message": { "type": "rate", "timestamp": 1596570660000, "step": 60000, "inputSize": { "total": 4, "details": { "app,www,:eq,name,request,:eq,:and,:sum,(,cluster,),:by": 4 } }, "intermediateSize": { "total": 2, "details": { "app,www,:eq,name,request,:eq,:and,:sum,(,cluster,),:by": 2 } }, "outputSize": { "total": 2, "details": {} } } } ``` -------------------------------- ### Metric Definition Example Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/GLOSSARY_SPEC.md Defines a metric with its description, unit, category, type, and associated tags. ```json { "metrics": { "sys.cpu.utilization": { "description": "CPU utilization as a percentage (0-100).", "unit": "percent", "category": "system/cpu", "link": "https://example.com/glossary/system/cpu/", "type": "gauge", "tags": { "id": { "description": "CPU identifier (user, system, iowait, etc.)", "values": ["user", "system", "nice", "iowait", "irq", "softirq", "steal", "idle"], "valuesType": "examples" }, "app": { "required": true } } } } } ``` -------------------------------- ### Boolean and Random Queries Source: https://github.com/netflix/atlas/blob/main/atlas-core/src/test/resources/queries.txt Examples of queries involving boolean logic and random data generation. ```APIDOC ## GET /api/v1/graph (Boolean and Random Queries) ### Description Executes queries involving boolean conditions or random data generation. ### Method GET ### Endpoint /api/v1/graph ### Parameters #### Query Parameters - **q** (string) - Required - The query string (e.g., ':false,:sum,' or ':random,'). - **w** (integer) - Optional - The width of the graph. - **h** (integer) - Optional - The height of the graph. - **e** (string) - Required - The end time for the data query. ### Request Examples - Boolean sum: `GET /api/v1/graph?q=:false,:sum,&w=200&h=100&e=2014-02-20T15:00&` - Random data: `GET /api/v1/graph?q=:random,&w=200&h=100&e=2014-02-20T15:00&` - Random data greater than a value: `GET /api/v1/graph?q=:random,0.4,:const,:gt,&w=200&h=100&e=2014-02-20T15:00&` ### Response #### Success Response (200) Returns graph data based on the boolean or random query. ``` -------------------------------- ### Example Git Commit Message Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Follow this structure for commit messages, including a concise summary and a detailed explanation. Ensure a blank line separates the summary from the body. ```git Short (50 chars or less) summary of changes More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the email subject and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together. Further paragraphs come after blank lines. - Bullet points are okay, too - Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank lines in between, but conventions vary here ``` -------------------------------- ### Get All Expressions Source: https://github.com/netflix/atlas/blob/main/atlas-lwcapi/README.md Retrieves a list of all active expression subscriptions for the API cluster. This can be filtered by cluster, app, or stack. ```json { "expressions": [{ "expression": "nf.region,us-east-1,:eq,nf.cluster,testcluster,:eq,:and,name,cpuALL.stolen,:eq,:and,:sum,(,nf.node,),:by", "frequency": 60000, "id": "c80bebe3cd68fd1828f627d279584c7891162aa0" }, { "expression": "nf.app,testapp,:eq,error,400,:eq,:and,name,downstreamErrors,:eq,:and,:sum", "frequency": 60000, "id": "29b77f4d9c156a8db7db8d642f1ead63fc610887" }] } ``` -------------------------------- ### Get Stream Summary and Subscriptions Source: https://github.com/netflix/atlas/blob/main/atlas-lwcapi/README.md Retrieves a summary of a specific stream, including its metadata and the list of expressions it is subscribed to. The `receivedMessages` and `droppedMessages` reflect the current minute interval. ```json { "metadata": { "streamId": "96a784fe-e335-4e76-b3d4-d7b401f65e16", "remoteAddress": "127.0.0.1:54065", "receivedMessages": { "current": 1092 }, "droppedMessages": { "current": 0 } }, "subscriptions": [{ "expression": "nf.region,us-east-1,:eq,nf.cluster,testcluster,:eq,:and,name,cpuALL.stolen,:eq,:and,:sum,(,nf.node,),:by", "frequency": 60000, "id": "c80bebe3cd68fd1828f627d279584c7891162aa0" }, { "expression": "nf.app,testapp,:eq,error,400,:eq,:and,name,downstreamErrors,:eq,:and,:sum", "frequency": 60000, "id": "29b77f4d9c156a8db7db8d642f1ead63fc610887" }] } ``` -------------------------------- ### Get Streams Source: https://github.com/netflix/atlas/blob/main/atlas-lwcapi/README.md Retrieves a list of streams attached to a particular LWC instance. If a stream ID is provided, it returns a summary and the expressions the stream is subscribed to. ```APIDOC ## GET /api/v1/streams[/] ### Description Provides a list of streams attached to a particular LWC instance. It does not list streams for an entire cluster. To find the expressions evaluated for a particular stream, append the stream ID to the URI path. ### Method GET ### Endpoint `/api/v1/streams[/]` ### Parameters #### Query Parameters None ### Response #### Success Response (200) When called without a stream ID path, returns a list of active stream summaries. When called with a stream ID, returns a summary and the list of expressions the stream is subscribed to. **Response (without stream ID):** ```json [ { "streamId": "96a784fe-e335-4e76-b3d4-d7b401f65e16", "remoteAddress": "127.0.0.1:54065", "receivedMessages": { "current": 50 }, "droppedMessages": { "current": 0 } }, { "streamId": "a5f83589-bf3f-4692-9e28-df47dfe8333c", "remoteAddress": "127.0.0.1:53109", "receivedMessages": { "current": 128 }, "droppedMessages": { "current": 0 } } ] ``` **Response (with stream ID):** ```json { "metadata": { "streamId": "96a784fe-e335-4e76-b3d4-d7b401f65e16", "remoteAddress": "127.0.0.1:54065", "receivedMessages": { "current": 1092 }, "droppedMessages": { "current": 0 } }, "subscriptions": [ { "expression": "nf.region,us-east-1,:eq,nf.cluster,testcluster,:eq,:and,name,cpuALL.stolen,:eq,:and,:sum,(,nf.node,),:by", "frequency": 60000, "id": "c80bebe3cd68fd1828f627d279584c7891162aa0" }, { "expression": "nf.app,testapp,:eq,error,400,:eq,:and,name,downstreamErrors,:eq,:and,:sum", "frequency": 60000, "id": "29b77f4d9c156a8db7db8d642f1ead63fc610887" } ] } ``` The `receivedMessages` and `droppedMessages` represent the number of messages in current minute interval (not the lifetime of the stream). `subscriptions` is the list of expressions, their ID and step size (frequency at which data is emitted). ``` -------------------------------- ### Build and Test with SBT Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Run basic build and tests for the Atlas project using the provided SBT launcher script. ```bash $ project/sbt test ``` -------------------------------- ### Check License Headers with SBT Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Verify that all source files include the correct license headers using the SBT command. ```bash $ project/sbt checkLicenseHeaders ``` -------------------------------- ### Run Full Validation with Makefile Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Execute local validation mirroring PR builds, including license header and formatting checks, using the makefile. ```bash $ make ``` -------------------------------- ### Graph Query with Stacking Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Demonstrates how to enable stacking for graph data. ```APIDOC ## GET /api/v1/graph with Stacking ### Description Fetches graph data with the stacking option enabled. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string. - **stack** (string) - Optional - Enables stacking of graph elements. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=name,sps,:eq,:sum,2,:lw,(,0h,1d,1w,),:offset,:stack&zoom=2.0 ``` ### Response #### Success Response (200) - Stacked graph data. ``` -------------------------------- ### Get Expressions Source: https://github.com/netflix/atlas/blob/main/atlas-lwcapi/README.md Retrieves a list of active expression subscriptions for the entire API cluster. This endpoint can optionally be filtered by cluster, application, or stack. ```APIDOC ## GET /lwc/api/v1/expressions[/] ### Description Provides the list of active expression subscriptions for the entire API cluster. Optionally allows filtering on expressions that would affect a given `nf.cluster`, `nf.app` or `nf.stack`. ### Method GET ### Endpoint `/lwc/api/v1/expressions[/]` ### Parameters #### Header Parameters - **If-None-Match** (string) - Optional - Hex encoded CRC-32 signature of the expressions set used to determine if the set is the same across nodes in a cluster. If the signature matches, a 304 Not Modified response is returned. If the signature does not match, the full expression set is returned with a 200 status code. #### Query Parameters None ### Response #### Success Response (200) - **expressions** (array) - A list of expression objects, each containing: - **expression** (string) - The expression string. - **frequency** (integer) - The frequency in milliseconds at which the expression is evaluated. - **id** (string) - The unique identifier for the expression. ### Response Example ```json { "expressions": [ { "expression": "nf.region,us-east-1,:eq,nf.cluster,testcluster,:eq,:and,name,cpuALL.stolen,:eq,:and,:sum,(,nf.node,),:by", "frequency": 60000, "id": "c80bebe3cd68fd1828f627d279584c7891162aa0" }, { "expression": "nf.app,testapp,:eq,error,400,:eq,:and,name,downstreamErrors,:eq,:and,:sum", "frequency": 60000, "id": "29b77f4d9c156a8db7db8d642f1ead63fc610887" } ] } ``` ``` -------------------------------- ### Format License Headers with SBT Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Automatically add or fix license headers in source files using the SBT command. ```bash $ project/sbt formatLicenseHeaders ``` -------------------------------- ### Graph Query with Area, Alpha, and Stack Options Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Demonstrates advanced graph styling with area, alpha transparency, and stacking. ```APIDOC ## GET /api/v1/graph with Area, Alpha, and Stack Options ### Description Fetches graph data with options for area display, alpha transparency, and stacking. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including area, alpha, and stack directives. - **u.2** (string) - Optional - Upper bound for the second y-axis. - **l.2** (string) - Optional - Lower bound for the second y-axis. - **stack** (string) - Optional - Enables stacking. - **stack.1** (string) - Optional - Enables stacking for a specific series. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=42,name,sps,:eq,:sum,(,nf.cluster,),:by,1,:axis,37,:area,40,:alpha,2,:axis&u.2=100&l.2=0&stack=1 ``` ### Response #### Success Response (200) - Graph data styled with area, alpha transparency, and stacking. ``` -------------------------------- ### Graph Query with Offset and Color Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Demonstrates how to use query parameters to apply offsets and colors to the graph data. ```APIDOC ## GET /api/v1/graph with Offset and Color ### Description Fetches graph data with specific offsets and color configurations. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including offset and color directives. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=name,sps,:eq,:sum,(,),:offset,f00,:color ``` ### Response #### Success Response (200) - Graph data with applied offsets and colors. ``` -------------------------------- ### Check Code Formatting with SBT Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Ensure code consistency by checking formatting using scalafmt via SBT. ```bash $ project/sbt scalafmt::test test:scalafmt::test ``` -------------------------------- ### Get Active Stream Summaries Source: https://github.com/netflix/atlas/blob/main/atlas-lwcapi/README.md Retrieves a list of active stream summaries when called without a stream ID. This includes stream ID, remote address, and message counts. ```json [ { "streamId": "96a784fe-e335-4e76-b3d4-d7b401f65e16", "remoteAddress": "127.0.0.1:54065", "receivedMessages": { "current": 50 }, "droppedMessages": { "current": 0 } }, { "streamId": "a5f83589-bf3f-4692-9e28-df47dfe8333c", "remoteAddress": "127.0.0.1:53109", "receivedMessages": { "current": 128 }, "droppedMessages": { "current": 0 } } ] ``` -------------------------------- ### Graph Query with Color and Swap Axis Configuration Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Shows how to apply color and swap axis configurations to graph data. ```APIDOC ## GET /api/v1/graph with Color and Swap Axis Configuration ### Description Retrieves graph data with specific color and axis swapping configurations. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including color and swap axis directives. - **u.2** (string) - Optional - Upper bound for the second y-axis. - **l.2** (string) - Optional - Lower bound for the second y-axis. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=42,name,sps,:eq,:sum,:dup,1w,:offset,1,:axis,f00,:color,:swap,1,:axis,37,:area,40,:alpha,2,:axis&u.2=100&l.2=0 ``` ### Response #### Success Response (200) - Graph data with applied color and swapped axis configurations. ``` -------------------------------- ### Graph Layout Options Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Demonstrates different layout options for graph visualization, including canvas, image, and interactive modes. ```APIDOC ## GET /api/v1/graph with Layout Options ### Description Retrieves graph data with various layout options for different display modes. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **q** (string) - Required - Query string. - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **w** (string) - Optional - Width of the graph. - **h** (string) - Optional - Height of the graph. - **layout** (string) - Required - Specifies the layout mode (e.g., 'canvas', 'image', 'iw', 'ih'). - **title** (string) - Optional - Sets a title for the graph. ### Request Example ``` GET /api/v1/graph?q=name,sps,:eq,:sum,(,nf.cluster,),:by,:stack&s=e-3h&e=2015-03-10T13:13&w=70&h=70&layout=canvas ``` ### Response #### Success Response (200) - Graph data formatted according to the specified layout. ``` -------------------------------- ### Graph Query with Grouping and Axis Configuration Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Shows how to group data and configure axes for the graph. ```APIDOC ## GET /api/v1/graph with Grouping and Axis Configuration ### Description Retrieves graph data, allowing grouping by a specified field and configuring axis properties. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including grouping and axis configuration. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=42,name,sps,:eq,:sum,(,nf.cluster,),:by,1,:axis ``` ### Response #### Success Response (200) - Graph data grouped and configured with specified axes. ``` -------------------------------- ### Create Dynamic Set Processor Source: https://github.com/netflix/atlas/blob/main/atlas-eval/README.md Initializes a processor that accepts `DataSources` and outputs `MessageEnvelope` objects for matching sets. This is efficient for evaluating multiple expressions. ```java Processor processor = evaluator.createStreamsProcessor(); ``` -------------------------------- ### Graph Query with Offset and Axis Configuration Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Demonstrates using offset and axis configuration in graph queries. ```APIDOC ## GET /api/v1/graph with Offset and Axis Configuration ### Description Fetches graph data with offset and axis configuration parameters. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including offset and axis configuration. - **u.2** (string) - Optional - Upper bound for the second y-axis. - **l.2** (string) - Optional - Lower bound for the second y-axis. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=42,name,sps,:eq,:sum,:dup,1w,:offset,1,:axis,:swap,1,:axis,37,:area,40,:alpha,2,:axis&u.2=100&l.2=0 ``` ### Response #### Success Response (200) - Graph data with offset and axis configurations applied. ``` -------------------------------- ### Graph Styling and Visualization Options Source: https://github.com/netflix/atlas/blob/main/atlas-core/src/test/resources/queries.txt This section details various parameters for styling the graph, including palettes, stacking, legends, and color vision simulation. ```APIDOC ## GET /api/v1/graph (Styling and Visualization) ### Description Customizes the appearance and visualization of the graph using various parameters. ### Method GET ### Endpoint /api/v1/graph ### Parameters #### Query Parameters - **stack** (integer) - Optional - Enables stacked area chart (e.g., 1). - **palette** (string) - Optional - Specifies the color palette (e.g., 'blues', 'greens', 'colors:R,G,B,...'). - **no_legend** (integer) - Optional - Disables the legend (e.g., 1). - **vision** (string) - Optional - Color vision simulation mode (e.g., 'normal', 'deuteranopia', 'tritanomaly'). - **e** (string) - Required - The end time for the data query. - **tz** (string) - Optional - The timezone for the time range. ### Request Examples - Stacked graph with custom palette: `GET /api/v1/graph?q=1,1,1,1,1,1&stack=1&palette=colors:1a9850,91cf60,d9ef8b,fee08b,fc8d59,d73027&no_legend=1&e=2012-01-01T09:00&tz=UTC` - Stacked graph with predefined palette: `GET /api/v1/graph?q=1,1,1,1,1,1,1&stack=1&palette=blues&no_legend=1&e=2012-01-01T09:00&tz=UTC` - Color vision simulation: `GET /api/v1/graph?q=1,1,1,1,1,1,1&stack=1&vision=achromatomaly&no_legend=1&e=2012-01-01T09:00&tz=UTC` ### Response #### Success Response (200) Returns the graph image with applied styling and visualization options. ``` -------------------------------- ### Graph Query with Line Width and Time Intervals Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Shows how to specify line width and time intervals for the graph data. ```APIDOC ## GET /api/v1/graph with Line Width and Time Intervals ### Description Retrieves graph data, allowing specification of line width and time intervals. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including line width and time interval specifications. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=name,sps,:eq,:sum,2,:lw,(,0h,1d,1w,),:offset,f00,:color ``` ### Response #### Success Response (200) - Graph data with specified line width and time intervals. ``` -------------------------------- ### Publish Atlas Wiki Changes Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Run this command to publish documentation changes to the GitHub wiki after a pull request has been merged. This is a maintainer-only action. ```bash $ make publish-wiki ``` -------------------------------- ### Constant Value Operations Source: https://github.com/netflix/atlas/blob/main/atlas-core/src/test/resources/queries.txt Demonstrates various operations applied to constant values, such as absolute value, negation, square root, and derivative. ```APIDOC ## GET /api/v1/graph (Constant Operations) ### Description Applies various mathematical and logical operations to constant values. ### Method GET ### Endpoint /api/v1/graph ### Parameters #### Query Parameters - **q** (string) - Required - The query string defining the constant and the operation (e.g., '-64.0,:const,:abs,'). - **w** (integer) - Optional - The width of the graph. - **h** (integer) - Optional - The height of the graph. - **e** (string) - Required - The end time for the data query. ### Request Examples - Absolute value: `GET /api/v1/graph?q=-64.0,:const,:abs,&w=200&h=100&e=2014-02-20T15:00&` - Negation: `GET /api/v1/graph?q=-64.0,:const,:neg,&w=200&h=100&e=2014-02-20T15:00&` - Per-step: `GET /api/v1/graph?q=-64.0,:const,:per-step,&w=200&h=100&e=2014-02-20T15:00&` - Square root: `GET /api/v1/graph?q=-64.0,:const,:sqrt,&w=200&h=100&e=2014-02-20T15:00&` ### Response #### Success Response (200) Returns graph data representing the result of the constant operation. ``` -------------------------------- ### Axis Per Line Configuration Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Shows how to configure graphs to display axes independently for each line. ```APIDOC ## GET /api/v1/graph with Axis Per Line ### Description Fetches graph data with the 'axis_per_line' option enabled, allowing separate axes for each data line. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string. - **axis_per_line** (string) - Required - Set to '1' to enable axis per line. - **ylabel** (string) - Optional - Default y-axis label. - **ylabel.0** (string) - Optional - Label for the first y-axis. - **ylabel.1** (string) - Optional - Label for the second y-axis. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=name,sps,:eq,:sum,(,nf.cluster,),:by&axis_per_line=1 ``` ### Response #### Success Response (200) - Graph data with independent axes for each line. ``` -------------------------------- ### Area Chart with Label and Limit Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Shows how to configure labels and limits for an area chart. ```APIDOC ## GET /api/v1/graph with Area Chart Label and Limit ### Description Fetches data for an area chart, allowing configuration of labels and limits. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including the ':area' directive. - **l** (string) - Optional - Limit for the data display. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=42,:area&l=30 ``` ### Response #### Success Response (200) - Area chart data with specified labels and limits. ``` -------------------------------- ### Global Tag Key Definitions Source: https://github.com/netflix/atlas/blob/main/atlas-lsp/GLOSSARY_SPEC.md Defines globally recognized tag keys with their descriptions, categories, and optional value constraints. ```json { "tagKeys": { "app": { "description": "Application name.", "category": "infrastructure" }, "region": { "description": "Cloud region where the instance is running.", "category": "infrastructure", "values": ["us-east-1", "us-west-2", "eu-west-1"], "valuesType": "examples" }, "statistic": { "description": "Identifies the component of a conceptual type (count, totalTime, gauge, etc.).", "category": "type-system", "link": "https://netflix.github.io/atlas-docs/asl/conceptual-types/", "valuesType": "enum", "values": [ "count", "totalTime", "totalOfSquares", "max", "gauge", "activeTasks", "duration", "totalAmount", "percentile" ] } } } ``` -------------------------------- ### Graph Query with Color and Area Styling Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Shows how to apply specific colors and area styling to graph elements. ```APIDOC ## GET /api/v1/graph with Color and Area Styling ### Description Retrieves graph data with custom color and area styling applied. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including color and area directives. - **u.2** (string) - Optional - Upper bound for the second y-axis. - **l.2** (string) - Optional - Lower bound for the second y-axis. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=42,name,sps,:eq,:sum,(,nf.cluster,),:by,1,:axis,f00,:color,37,:area,40,:alpha,2,:axis&u.2=100&l.2=0 ``` ### Response #### Success Response (200) - Graph data with specified color and area styling. ``` -------------------------------- ### Fix Code Formatting with SBT Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Automatically fix code formatting issues across the project using scalafmt via SBT. ```bash $ project/sbt scalafmt test:scalafmt ``` -------------------------------- ### Line and Area Styles Source: https://github.com/netflix/atlas/blob/main/atlas-core/src/test/resources/queries.txt This query demonstrates how to specify line and area styles for the graph. ```APIDOC ## GET /api/v1/graph (Line and Area Styles) ### Description Specifies the visual style of the graph as line or area. ### Method GET ### Endpoint /api/v1/graph ### Parameters #### Query Parameters - **q** (string) - Required - The query string including style operations like 'line,:ls' or 'area,:ls'. - **w** (integer) - Optional - The width of the graph. - **h** (integer) - Optional - The height of the graph. - **e** (string) - Required - The end time for the data query. ### Request Examples - Line style: `GET /api/v1/graph?q=42.0,:const,line,:ls&w=200&h=100&e=2014-02-20T15:00&` - Area style: `GET /api/v1/graph?q=42.0,:const,area,:ls&w=200&h=100&e=2014-02-20T15:00&` ### Response #### Success Response (200) Returns the graph image with the specified line or area style. ``` -------------------------------- ### Graph Query for Area Chart Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Demonstrates fetching data specifically for an area chart. ```APIDOC ## GET /api/v1/graph for Area Chart ### Description Retrieves data suitable for rendering as an area chart. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **s** (string) - Required - Start time for the data range. - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string, often including the ':area' directive. ### Request Example ``` GET /api/v1/graph?s=e-1d&e=2012-01-01T00:00&q=42,:area ``` ### Response #### Success Response (200) - Data formatted for an area chart. ``` -------------------------------- ### Create Standalone Evaluator Instance Source: https://github.com/netflix/atlas/blob/main/atlas-eval/README.md Instantiates the `Evaluator` class manually for standalone use. Requires configuration, a registry, and an ActorSystem. ```java Config config = ConfigFactory.load(); Registry registry = new DefaultRegistry(); ActorSystem system = ActorSystem.create("eval", config); Evaluator evaluator = new Evaluator(config, registry, system); ``` -------------------------------- ### Create Publisher from Atlas Graph URI Source: https://github.com/netflix/atlas/blob/main/atlas-eval/README.md Generates a reactive streams Publisher from a given Atlas graph URI. This publisher emits `TimeSeriesMessage` objects. ```java String uri = "http://localhost:7101/api/v1/graph?q=name,ssCpuUser,:eq,:avg"; Publisher publisher = evaluator.createPublisher(uri); ``` -------------------------------- ### Graph with Delta Calculation Source: https://github.com/netflix/atlas/blob/main/atlas-core/src/test/resources/queries.txt This query demonstrates calculating the week-over-week delta for a metric. It uses the 'offset' and 'sub' operations within the query string to achieve this. ```APIDOC ## GET /api/v1/graph (Delta Calculation) ### Description Calculates and visualizes the week-over-week delta for a given metric. ### Method GET ### Endpoint /api/v1/graph ### Parameters #### Query Parameters - **e** (string) - Required - The end time for the data query. - **s** (string) - Required - The start time for the data query. - **tz** (string) - Optional - The timezone for the time range. - **q** (string) - Required - The query string including operations like ':offset' and ':sub' for delta calculation. - **h** (integer) - Optional - The height of the graph. - **w** (integer) - Optional - The width of the graph. ### Request Example ```http GET /api/v1/graph?e=2012-01-01T12:00&s=e-12h&tz=UTC&q=nf.cluster,alerttest,:eq,name,requestsPerSecond,:eq,:and,:sum,:dup,1w,:offset,:sub,:area,delta+week+over+week,:legend&h=150&w=750 ``` ### Response #### Success Response (200) Returns an image of the graph representing the calculated delta. ``` -------------------------------- ### Atlas Version Number Format Source: https://github.com/netflix/atlas/blob/main/CONTRIBUTING.md Illustrates the standard [major].[minor].[patch] version number format used for Atlas releases. ```plaintext [major].[minor].[patch] ``` -------------------------------- ### Graph Query with Time and Minute of Hour Source: https://github.com/netflix/atlas/blob/main/atlas-webapi/src/test/resources/others.md Shows a query that specifies time and extracts the minute of the hour. ```APIDOC ## GET /api/v1/graph with Time and Minute of Hour ### Description Fetches graph data, specifying a time range and querying for the minute of the hour. ### Method GET ### Endpoint /api/v1/graph ### Query Parameters - **e** (string) - Required - End time for the data range. - **q** (string) - Required - Query string including 'minuteOfHour' and ':time'. - **s** (string) - Required - Start time for the data range. ### Request Example ``` GET /api/v1/graph?s=e-10m&e=2015-05-26T19:52&q=minuteOfHour,:time ``` ### Response #### Success Response (200) - Data representing the minute of the hour within the specified time range. ```