All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.honeycomb.beeline.spring.utils.BeelineUtils Maven / Gradle / Ivy

Go to download

Spring Boot Starter module to auto-configure Spring Boot with the Honeycomb Beeline for Java

There is a newer version: 2.2.0
Show newest version
package io.honeycomb.beeline.spring.utils;

import io.honeycomb.beeline.tracing.Span;
import org.springframework.http.HttpHeaders;

public final class BeelineUtils {
    private BeelineUtils() {
        // utils
    }

    public static void tryAddHeader(final HttpHeaders headers,
                                    final Span span,
                                    final String headerKey,
                                    final String fieldKey) {
        final String headerValue = headers.getFirst(headerKey);
        if (headerValue != null) {
            span.addField(fieldKey, headerValue);
        }
    }

    public static void tryAddField(final Span span, final String fieldName, final Object value) {
        if (value != null) {
            span.addField(fieldName, value);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy