Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[out_stackdriver] Support customizing log entry http request field in Stackdriver output plugin #4200

Closed
qingling128 opened this issue Oct 18, 2021 · 1 comment

Comments

@qingling128
Copy link
Collaborator

Bug Report

Describe the bug
Inconsistent Google Cloud Logging LogEntry fields naming convention in the out_stackdriver plugin for http_request.

#define OPERATION_FIELD_IN_JSON "logging.googleapis.com/operation"

#define OPERATION_FIELD_IN_JSON "logging.googleapis.com/operation"
#define MONITORED_RESOURCE_KEY "logging.googleapis.com/monitored_resource"
#define LOCAL_RESOURCE_ID_KEY "logging.googleapis.com/local_resource_id"
#define DEFAULT_LABELS_KEY "logging.googleapis.com/labels"
#define DEFAULT_SEVERITY_KEY "logging.googleapis.com/severity"
#define DEFAULT_TRACE_KEY "logging.googleapis.com/trace"
#define DEFAULT_LOG_NAME_KEY "logging.googleapis.com/logName"
#define DEFAULT_INSERT_ID_KEY "logging.googleapis.com/insertId"
#define SOURCELOCATION_FIELD_IN_JSON "logging.googleapis.com/sourceLocation"
#define HTTPREQUEST_FIELD_IN_JSON "logging.googleapis.com/http_request"

Expected behavior
Camel cased field names as in https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry

Your Environment

  • Version used: Fluent Bit 1.8.8

Additional context
Simply changing logging.googleapis.com/http_request to logging.googleapis.com/httpRequest would likely be considered a breaking change. This either needs to wait for a breaking change release or make Fluent Bit compatible with both values.

@qingling128
Copy link
Collaborator Author

In fact, if we can add something like below (similar to https://github.com/fluent/fluent-bit/blob/master/plugins/out_stackdriver/stackdriver_conf.c#L314-L320)

    tmp = flb_output_get_property("http_request_key", ins);
    if (tmp) {
        ctx->http_request_key = flb_sds_create(tmp);
    }
    else {
        ctx->http_request_key = flb_sds_create(HTTPREQUEST_FIELD_IN_JSON);
    }

and feed that context into the actual place where HTTPREQUEST_FIELD_IN_JSON is being used, it should solve our need.

Braydon from our side is drafting a PR for this.

@qingling128 qingling128 changed the title [out_stackdriver] LogEntry field name inconsistency [out_stackdriver] Support customizing log entry http request field in Stackdriver output plugin Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant