This month we've learned: fzf, Datadog and Teraform

栏目: IT技术 · 发布时间: 4年前

内容简介:This timeBesides terrific autocomplete feature, one of the greatest use cases I’ve discovered recently is the preview window. Say you want to quickly browse contents of all files that match your fuzzy search query. Normally, you do that by applying a

TMWL February 20' — fzf, Datadog & Teraform

Programmers say what they’ve learned

Mar 23 ·3min read

This month we've learned: fzf, Datadog and Teraform

This time Marcin and Michał have shared their discoveries from February:

  • how to launch a preview window in fzf;
  • how to automate with Datadog & Terraform.

Marcin Baraniecki — Frontend Engineer

fzf is a great tool to quickly find a file or autocomplete the command arguments — by name or pattern. It’s quick, it’s handy and it performs well when you don’t know the exact filename you’re looking for (by applying “fuzzy” search, match & completion).

Besides terrific autocomplete feature, one of the greatest use cases I’ve discovered recently is the preview window. Say you want to quickly browse contents of all files that match your fuzzy search query. Normally, you do that by applying a cat <filename> command. However, you can join both functionalities:

This month we've learned: fzf, Datadog and Teraform

After issuing a command above ( fzf — preview ‘cat {}’ ), a regular fzf search prompt shows up. This time, however, it additionally comes with a right-hand side preview window!

This month we've learned: fzf, Datadog and Teraform

Navigating through a list of files changes the output of the preview window. Additionally, that box can be scrolled independently (by hovering over it with your mouse)!

Preview window is a great feature that can be used with other bash commands, too. Displaying contents of a file ( cat command) is but a simplest one. What will YOU use it for?

Michał Matłoka — Senior Software Engineer & Architect

It is good to automate. There are things that are just quite obvious — deployments — CI & CD, environments set up etc. However there happen to be some small little things which people tend to omit. One of those things are Datadog dashboards. During this month, I’ve learned that it is pretty simple to bring dashboard definition to your codebase and “deploy” it automatically to Datadog.

Terraform documentation includes a clean description how you can define your dashboards. The definition format is quite similar to the export you can download, from the Datadog website. The main difference is that export is in JSON and terraform uses yaml. How does a single-widget dashboard definition look like? It is pretty simple:

provider “datadog” {
  api_key = “${var.datadog_api_key}”
  app_key = “${var.datadog_app_key}”
}resource “datadog_dashboard” “ordered_dashboard” {
  title = “Potato service”
  layout_type = “ordered”
  is_read_only = true  widget {
    timeseries_definition {
      title = “avg meal time (ms)”
      show_legend = false
      request {
        q = “avg:patato_service.meals.avg{service:patato_service,$environment}”
        display_type = line
      }
    }
  }
}

Terrafrom Datadog integration does not offer only support for dashboards. You can define there logs indexes, monitors and a lot of other things. If you are using Datadog, then definitely you should take a look at the Datadog integration .


以上所述就是小编给大家介绍的《This month we've learned: fzf, Datadog and Teraform》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

统计思维:程序员数学之概率统计

统计思维:程序员数学之概率统计

Allen B.Downey / 张建锋、陈钢 / 人民邮电出版社 / 2013-5 / 29.00元

代码跑出来的概率统计问题; 程序员的概率统计开心辞典; 开放数据集,全代码攻略。 现实工作中,人们常被要求用数据说话。可是,数据自己是不能说话的,只有对它进行可靠分析和深入挖掘才能找到有价值的信息。概率统计是数据分析的通用语言,是大数据时代预测未来的根基。 站在时代浪尖上的程序员只有具备统计思维才能掌握数据分析的必杀技。本书正是一本概率统计方面的入门图书,但视角极为独特,折......一起来看看 《统计思维:程序员数学之概率统计》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具