Summary

The featureFlags() GraphQL query lists feature flags depending on filters and context. All flags should be considered beta features. Enabling features marked as experimental is strongly discouraged and may cause LogScale to enter an unrecoverable state.

Syntax

graphql
featureFlags(
      includeExperimentalFeatures: Boolean,
      enabledInScopeFilter: EnabledInScope
   ): [FeatureFlagV2!]!

The results of this query can be extensive. Use the enabledInScopeFilter parameter to return only what you want or need (for example, UserScope for user-scoped features).

Set includeExperimentalFeatures to true to include experimental flags in results. Experimental features are strongly discouraged for production use.

Example

Raw
graphql
query {featureFlags(
     includeExperimentalFeatures: true,
     enabledInScopeFilter: Disabled
     )
  {flag, experimental, description}
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "query {featureFlags(
     includeExperimentalFeatures: true,
     enabledInScopeFilter: Disabled
     )
  {flag, experimental, description}
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "query {featureFlags(
     includeExperimentalFeatures: true,
     enabledInScopeFilter: Disabled
     )
  {flag, experimental, description}
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "query {featureFlags( ^
     includeExperimentalFeatures: true, ^
     enabledInScopeFilter: Disabled ^
     ) ^
  {flag, experimental, description} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {featureFlags(
     includeExperimentalFeatures: true,
     enabledInScopeFilter: Disabled
     )
  {flag, experimental, description}
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "query {featureFlags(
     includeExperimentalFeatures: true,
     enabledInScopeFilter: Disabled
     )
  {flag, experimental, description}
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "query {featureFlags(
     includeExperimentalFeatures: true,
     enabledInScopeFilter: Disabled
     )
  {flag, experimental, description}
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "query {featureFlags(
     includeExperimentalFeatures: true,
     enabledInScopeFilter: Disabled
     )
  {flag, experimental, description}
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "featureFlags": [
      {
        "flag": "AlternateQueryMergeTargetHandling",
        "experimental": true,
        "description": "Enables alternate query merge target handling"
      },
      {
        "flag": "ArrayFunctions",
        "experimental": true,
        "description": "Enable ArrayFunctions in query language."
      },
      {
        "flag": "CachePolicies",
        "experimental": true,
        "description": "Prioritize newer over older segments."
      },
      {
        "flag": "CustomIngestTokens",
        "experimental": false,
        "description": "Enable custom ingest tokens not generated by LogScale."
      },
      ...
  }
}

The results would normally be very lengthy. They have been shortened to save space on this page.

Input Parameters

Use the input parameters to limit results to a specific scope or to exclude experimental features.

Table: Input Parameters & Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this query. Since one of the parameters uses a special datatype, an additional table is included below with its parameters.
enabledInScopeFilter EnabledInScope     Which scope feature flags should be returned. See table below.
includeExperimentalFeatures Boolean     Whether to include experimental features.

The results of this query can be extensive. The enumerated list is used to set the scope of which feature flags should be returned, such as global, organization, or user based.

Table: EnabledInScope Enum Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
Disabled      
GlobalScope      
OrganizationScope      
UserScope      

Returned Values

Returns a non-nullable list of FeatureFlagV2 objects. The table below lists all fields:

Table: FeatureFlagV2 Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
descriptionStringyes Short-Term  
experimentalBooleanyes Short-Term  
flagFeatureFlagyes Short-Term Â