[英]Collecting metrics for your application
Curious how people are integrating sending of metrics to graphite. 很好奇人们如何集成向石墨发送指标。 It appears most are using a client (many available on statsd github) that sends to statsd which sends on to carbon.
似乎大多数人正在使用发送到statsd并发送到carbon的客户端(许多在statsd github上可用)。 My question is do you think it is ok to include this "cross cutting concern" as such directly into your code.
我的问题是,您认为可以将这种“跨领域关注点”直接包含在您的代码中吗? What I am seeing is my application code has went from been nice and clean to now not so nice and clean with code to gather metrics intertwined with my business code.
我所看到的是我的应用程序代码已经从原来的漂亮到现在变得不那么漂亮了,而使用代码来收集与我的业务代码交织在一起的指标。 Any thoughts?
有什么想法吗?
I do think that it's fine to include code to send business metrics in your application code. 我确实认为在应用程序代码中包含发送业务指标的代码很好。 As @tomer-peled says in his comment, there is a close analogy with logging.
就像@ tomer-peled在评论中所说的那样,与日志记录非常相似。
However I understand your reluctance to scatter this stuff around and possibly obfuscate the code. 但是,我知道您不愿意将这些内容分散在各处,并且可能使代码变得晦涩难懂。 My approach in situations like this is to accept a certain amount of mess to begin with, then as more examples emerge I try to identify emergent structures which point to abstractions that would clean things up a bit.
在这种情况下,我的方法是先接受一定数量的混乱,然后,随着更多示例的出现,我尝试确定出现结构,这些结构指向抽象,这些抽象将使事情变得有些混乱。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.