Comments (12)
I don't think it's possible to get the alias from the context - https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
Do you have any other suggestions?
from powertools-lambda-java.
from powertools-lambda-java.
For sure. Thank you all!
from powertools-lambda-java.
I think service_undefined
works well here, it matches the python implementation and gives us a service name to use when we implement Metrics. We'll need a reasonable default for that core util as well.
from powertools-lambda-java.
For sampling, I'm happy with the String / Double approach. If this was a public method I think it would be best as a unit. But because it's an environment variable I think it would only increase complexity.
from powertools-lambda-java.
I think
service_undefined
works well here, it matches the python implementation and gives us a service name to use when we implement Metrics. We'll need a reasonable default for that core util as well.
This is misleading, if we don't know the name, I would assume that is better to default to the FunctionName
or even FunctionName:Version
, until the customer properly configures it.
I don't think it's possible to get the alias from the context - https://docs.aws.amazon.com/lambda/latest/dg/java-context.html
Do you have any other suggestions?
getInvokedFunctionArn()
– Returns the Amazon Resource Name (ARN) that's used to invoke the function. Indicates if the invoker specified a version number or alias.
For sampling, I'm happy with the String / Double approach. If this was a public method I think it would be best as a unit. But because it's an environment variable I think it would only increase complexity.
I think the point here is readability, if the argument is called samplingRate
, I have to lookup/assume which is the actual unit, but this is totally style. Hopefully we have more inputs here.
from powertools-lambda-java.
W.r.t - service_undefined provides an opportunity for the customer to fix it. Service has also a deeper meaning as it acts as a namespace when looking for data across multiple functions be that logs, metrics or traces.
As to context, I don't know about Java, but in the Python context object it'll fetch a FQDN -- If it's a given published version or alias it'll be the last value <function_name>:<version_or_alias>
from powertools-lambda-java.
I'd be really happy to look at a PR for adding alias information.
from powertools-lambda-java.
W.r.t - service_undefined provides an opportunity for the customer to fix it. Service has also a deeper meaning as it acts as a namespace when looking for data across multiple functions be that logs, metrics or traces.
100%, but as soon as a customer incorporates that into multiple functions they will see service_undefined in multiple logstreams, or am I missing something? This goes hand-in-hand with tracing span naming which I'm in full agreement.
Now for the Alias, I'm seeking guidance on whether there's any logic behind or simply callee information.
from powertools-lambda-java.
Alias as part of the context was something discussed in the aws-lambda-java-libs project.
You might want to continue the discussion there.
from powertools-lambda-java.
Message, Unserializable JSON values will be casted to string, question: How? calling toString()? if so, tell that toString() will be called. Also, what about exceptions there? Will that be swollen?
This should be fixed as part of #113
from powertools-lambda-java.
@dgomesbr Can this issue be closed now based on some of the discussions above? 🤔
from powertools-lambda-java.
Related Issues (20)
- Putting metrics fails when POWERTOOLS_METRICS_NAMESPACE is not set HOT 3
- Logging: Trace ID not logged with Java 17 runtime HOT 1
- Feature enhancement: Create a Subsegments for operations handled by Powertools HOT 5
- Logging: print `message` as JSON, instead of wrapping into a string HOT 14
- Exceptions not showing in Traces HOT 1
- RFC: Introduce Version 2
- RFC: Remove support for Java 8 in V2 HOT 7
- Feature enhancement (Logger): automatically intercept Runtime exceptions, and log information HOT 7
- Log level not restored at the end of execution HOT 2
- Support batch secrets retrieval in Parameters module HOT 6
- Maintenance: update jackson and aws-xray-recorder dependencies together HOT 4
- RFC: handle batch messages in parallel in batch module HOT 12
- v2: Example logging configuration needs to be updated HOT 3
- v2 - Params builders do not supply default TransformationManager HOT 1
- bug - v2 - end-to-end tests broken
- AbstractCustomResourceHandler - Unable to send response HOT 2
- LambdaEcsLayout seems to incorrectly serialize the service field HOT 7
- Add support for CRaC
- RFC: support for multi-endpoint HTTP handler Lambda functions HOT 9
- Docs: Add Powertools for AWS Lambda workshop to documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powertools-lambda-java.